Reputation: 634
I need route to index.html.erb
? How can I do it? I tried root "index.html.erb#index"
in routes.rb
.
Upvotes: 0
Views: 1307
Reputation: 2659
First of all, in rails we set routes for our controller's method not for our view file. Get method of controller redirect to view the page itself.
Write below code in your routes.rb
:
get 'index', to: 'controller_name#index'
You can replace get 'index'
with any name like get 'users'
.
You can refer this for more reference.
Upvotes: 2