Rails routes direct index action to show action
- by jspooner
So I created some rspec_scaffold for an Exercise model and added "map.resource :exercises" to my routes file and I was surprised when the "/exercises" url rendered the show action. What the heck? Why doesn't that render the index action?
rake routes
new_exercises GET /exercises/new(.:format) {:controller=>"exercises", :action=>"new"}
edit_exercises GET /exercises/edit(.:format) {:controller=>"exercises", :action=>"edit"}
exercises GET /exercises(.:format) {:controller=>"exercises", :action=>"show"}
PUT /exercises(.:format) {:controller=>"exercises", :action=>"update"}
DELETE /exercises(.:format) {:controller=>"exercises", :action=>"destroy"}
POST /exercises(.:format) {:controller=>"exercises", :action=>"create"}