This project is archived and is in readonly mode.
Rails 3 forces singleton resource names to be a singular word
-
José Valim
- Assigned user set to josh
- Milestone cleared.
-
josh
- State changed from new to wontfix
Hmm, I'm split here.
Enforcing the singular convention and requiring explicit overrides seems good in a way.
resource :preference, :as => :preferencesIf you really want this, I'll accept a patch for it.
-
Mislav
I'm all for explicit overrides, but
:asonly lets me manually override the path segment. The url helpers still remain in singular form, and I want them in plural because that's how they were in the 2.3.x app.To me,
preference_pathjust looks wrong. It's not a single preference. It's a page with multiple preferences. Still, there's no way of overriding what word form will be used for these helpers. -
Andrew White
- Tag changed from pluralize, rails3, resource, routing, singleton to patch, pluralize, rails3, resource, routing, singleton
This is also a problem for me bringing sites forward as most of them have singleton resources named settings. Obviously it's a relatively easy fix to search and replace settings_path with setting_path in all the views but I'm in agreement with Mislav that it just looks wrong.
I've attached a patch which restores the behaviour from 2.3 and adds a failing test.
BTW, I had to update rack-mount to 0.6.1 to get all the tests to pass - maybe you want to bump the dependency in the gemspec.
-
josh
- State changed from wontfix to open
-
Repository
- State changed from open to resolved
(from [96bc6bcfee704701de1a9c4c3c6a7c265610d34d]) Don't force singularization of singleton resource names, e.g. /preferences [#4089 Rails 3 forces singleton resource names to be a singular word state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com
http://github.com/rails/rails/commit/96bc6bcfee704701de1a9c4c3c6a7c... -
Mislav
Thanks for fixing this!
