I have a Rails route definition that looks something like this:
namespace :admin do
resources :feeds
resources :push
end
rake routes generates the following output for it:
admin_feeds GET /admin/feeds {:controller=>"admin/feeds", :action=>"index"}
admin_push_index GET /admin/push {:controller=>"admin/push", :action=>"index"}
Why would would the path helper for push get the _index suffix, but not feeds?
It’s all based on the plurality of the resource. So if the resource name is plural, then it has no need to add an
_indexsuffix since it’s inferred.If it is a singular resource name, then it adds the suffix for clarification since
admin_pushwould typically be ashowaction instead of theindexaction.