Marcos Icaza Marcos Icaza - 1 year ago 141
Apache Configuration Question

How to change root path in deployment in AWS-EC2 Ubuntu Linux using Apache 2?

Once we deploy our Rails app to AWS-EC2,but when we did our routing went all haywire. Rails wants to be the root. We want to be rails root path.


Rails.application.routes.draw do

resources :forms do
collection do
post :accept_item
resources :stores, m:'true'
match '/send_mail', to: 'stores#send_mail', via: 'post'
get 'products' => 'products#index', m:'true'
get 'stores' => 'stores#index', m:'true'
get 'transactions' => 'transactions#index', m:'true'
get 'inventories' => 'inventories#index', m:'true'
get 'about' => 'sites#about'
get 'man' => 'sites#index', m:'true'
root 'sites#index'


Answer Source

Why not wrap all of your routes in the routes file inside a scope such as:

scope path: '/myapp' do
  #routes here
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download