This project is archived and is in readonly mode.
polymorphic_url gives incorrect url for :has_one nested resource
-
Pratik
- Assigned user set to Michael Koziarski
-
CancelProfileIsBroken
Still broken under 2.3 final, though now getting URLs of the form
http://localhost:3000/orders/1/line.%23%3Cline:0x24cbe34%3E -
CancelProfileIsBroken
- Tag changed from actionpack, polymorphic, routes, url_helper to actionpack, bugmash, polymorphic, routes, url_helper
-
José Valim
I'm personally do not agree with checking for reflection and associations inside polymorphic_url. In my discussions with Yehuda, I get that this problem should be solved by looking into the router declaration, instead of inspecting the objects.
Today, you can solve the problem by giving a symbol, instead of the object:
polymorphic_url([@article, :response]) -
dira
-1 for the request. Using a symbol instead of an object reflect the definition of the route.
-
Dan Pickett
-1 sounds like a lot of overhead for something that can be handled by a symbol currently
-
José Valim
- Tag changed from actionpack, bugmash, polymorphic, routes, url_helper to actionpack, polymorphic, routes, url_helper
- State changed from new to wontfix
Marking this as won't fix, but this should be supported after router refactoring for Rails 3.0. Feel free to discuss more in the mailing list, Yehuda created a post exactly to address polymorphic_url issues: http://groups.google.com/group/rubyonrails-core/browse_thread/threa....