Reputation: 27
I setted my RoR app to run on bluehost. The Rails main page is already showing, however I can't show my app's main page. I tried to configure the routes.rb file, but it's not working. What should I try to make this work?
This is what I tried so far:
Rails.application.routes.draw do
resources :todos
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
root 'todos#index'
get 'todos/index'
post 'todos/index'
map.root :controller=>’todos’, :action=>’index’
In my 'local' app, I only used the root, get and post line. The last line "map.root..." I got from this tutorial: Setting up Ruby on Rails at Bluehost.
Upvotes: 1
Views: 56
Reputation: 8668
You are ending the routes block after resources :todos. Therefor the rest of the routes declared are ignored including your 'root_path'
Try:
Rails.application.routes.draw do
resources :todos
root 'todos#index'
get 'todos/index'
post 'todos/index'
end
Hope this helps.
Upvotes: 1