I'm attempting to change the route for an Rails app that I'm building. I'm using c9.io's IDE.
The route folder has the following code:
Rails.application.routes.draw do
get 'home/index'
end
When I change it to:
Rails.application.routes.draw do
get 'home#index'
end
So that I can route the index page to the home page it produces an error.
Do I need to change the code in my controller or view files?
I think you're trying to do this. You want to root the "/"
page to the home controller index action?
Rails.application.routes.draw do
root to: 'home#index'
end
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.