This project is archived and is in readonly mode.
Resource controller name pluralization regression
-
Repository
- State changed from open to resolved
(from [9a6fc9a540cd23af3ca061cb7406a6cdd5ad4294]) Don't force pluralization of controller name when defining a resource [#4980 Resource controller name pluralization regression state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/9a6fc9a540cd23af3ca061cb7406a6... -
Romain
Is it just me or is the very same bug still present in 3.0.3 on "map.resource" ?
For some reason,resource :admin, :only => [:show]results in the following "rake routes" output :
admin GET /admin(.:format) {:controller=>"admins", :action=>"show"}Notice how the "controller" name is pluralized (which IMHO makes even less sense since it's a singular resource).
-
David Phillips
It seems intentional that singular resources pluralize the controller name. The routing guide has this note:
Because you might want to use the same controller for a singular route (/account) and a plural route (/accounts/45), singular resources map to plural controllers.
-
David Phillips
I agree that pluralization by default rarely makes sense for singular resources, but unfortunately, it probably can't be changed now due to backwards compatibility.
