-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource Path Broken #4997
Comments
I created a scaffold using the stable version and everything looks fine. Which rails version are you using? |
@fxn it's a inflector issue: Loading development environment (Rails 3.2.1)
>> 'drives'.singularize
=> "drife" @kvnlnt you can fix it in ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular 'drive', 'drives'
end Loading development environment (Rails 3.2.1)
>> 'drives'.singularize
=> "drive" @fxn I think this may be one instance where the rule on inflection updates might be relaxed - I can't imagine anyone is relying on the |
ahhhhhhh! Inflectors. Thanks pixeltrix. I'm obviously still learning Rails concepts. I really appreciate your help. |
But how did you get a scaffold with those routes? I am still curious about that. |
I can reproduce like this:
This is with Rails 3.2.1 on Ruby 1.9.3. |
yep...exactly what I encountered.. I ran a scaffold..got those routes, thought I messed something up and therefore tried again...and same result. Was all mystery until I discovered these "inflectors". Which pixeltrix confirmed (thanks again). You tricky rails, you tricky. |
Was bitten by this today, I still don't understand how this makes sense:
Why not drive? - what is the logic behind this? |
I ran a scaffold with the name "Drive". All was well but I noticed the generated paths were "drife"...as in "new_drife_path" with an "F"!!!! I searched and replaced all instances of "drife" with "drive" and double checked my resources mapping, it's set to:
resources :drives
Even though I've changed any occurance of "drife" in my code and confirmed it's resource is correctly name a "rake routes" command still says "new_drife_path":
drive_index GET /drives(.:format) {:action=>"index", :controller=>"drives"}
POST /drives(.:format) {:action=>"create", :controller=>"drives"}
new_drife GET /drives/new(.:format) {:action=>"new", :controller=>"drives"}
edit_drife GET /drives/:id/edit(.:format) {:action=>"edit", :controller=>"drives"}
drive GET /drives/:id(.:format) {:action=>"show", :controller=>"drives"}
PUT /drives/:id(.:format) {:action=>"update", :controller=>"drives"}
DELETE /drives/:id(.:format) {:action=>"destroy", :controller=>"drives"}
Where in the heck are these paths being stored? I tried clearing every piece of cache i could think of...I even regenerated the controller...to no avail.
The text was updated successfully, but these errors were encountered: