I've put in some bug fixes and improvements to polymorphic routes, which all should integrate fine with the above namespaced poly routes patch (any conflicts should be trivial to resolve.)
1. added poly_url and poly_path method aliases for polymorphic_url and polymorphic_path, including action_ prefixed methods (new_poly_url, edit_poly_url, formatted_poly_url). Much easier to type this shorter form. http://dev.rubyonrails.org/ticket/8725 2. fixed polymorphic_path so that it accepts an options hash like polymorphic_url -- necessary when you need to feed in an action, e.g. polymorphic_path(@article, :action => 'new') http://dev.rubyonrails.org/ticket/8720 3. fixed polymorphic_url so that it generates :action => 'new' routes correctly with an array, e.g., calls the method "article_new_comment_url" instead of "new_article_comment_url" http://dev.rubyonrails.org/ticket/8719 4. Added handling of nil parent objects in an array argument to polymorphic url -- so, polymorphic_url([EMAIL PROTECTED], @child]) generates an url with the parent (/parents/1/children/5) unless @parent is nil, in which case it just generates the route for the child (/children/5). As a result, you can build views that handle any nesting situation without adding conditional logic -- <%= link_to @person.name, [EMAIL PROTECTED], @person] %> can generate both "/companies/1/people/5" and "/ people/5", depending upon if @company is set in the controller or not. http://dev.rubyonrails.org/ticket/8705 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
