This project is archived and is in readonly mode.
Unable to handle Urls for not-pluralizeable Resources
Reported by Benjamin Hüttinger | September 28th, 2008 @ 03:48 PM | in 3.x
If the name of a Resource is the same as for singular and plural rails url-helpers seem to have trouble generating the appropriate urls.
I found some old (Trac) Tickets, but there never seems to have been a sollution.
Simple Example "News"
news_path(news) # works fine
news_path # does not work, singular helper but we want it to be index
simple fix for that would be
def news_path(news = nil)
return news_index_path if news.nil? || news.new_record?
super
end
If that sounds like a proper way to be added to the core i'd take this as a chance to submit my first patch.
Comments and changes to this ticket
-
Pratik January 18th, 2009 @ 05:56 AM
- State changed from new to incomplete
Hey,
Could you please submit a failing test case ?
Thanks.
-
Ryan Bigg April 10th, 2010 @ 10:56 AM
- Assigned user set to Mikel Lindsaar
Solution: use route names that can be properly pluralized.
-
Mike Riley July 29th, 2010 @ 05:18 PM
- State changed from incomplete to resolved
- Importance changed from to
Hello,
Due to the date since the last update and because it is incomplete, I am going to close this ticket. If you can provide a failing test case we can investigate this further.
Mike Riley
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>