From fa0cff484a8f0c99480b7545fc77610009723147 Mon Sep 17 00:00:00 2001 From: wangjohn Date: Tue, 28 May 2013 00:57:02 -0400 Subject: Adding documentation to +polymorphic_url+ concerning the options that it inherits from +url_for+. The way that +polymorhpic_url+ is built allows it to have options like +:anchor+, +:script_name+, etc. but this is currently not documented. --- .../lib/action_dispatch/routing/polymorphic_routes.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb index 6d3f8da932..2fb03f2712 100644 --- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb @@ -74,6 +74,19 @@ module ActionDispatch # * :routing_type - Allowed values are :path or :url. # Default is :url. # + # Also includes all the options from url_for. These include such + # things as :anchor or :trailing_slash. Example usage + # is given below: + # + # polymorphic_url([blog, post], anchor: 'my_anchor') + # # => "http://example.com/blogs/1/posts/1#my_anchor" + # polymorphic_url([blog, post], anchor: 'my_anchor', script_name: "/my_app") + # # => "http://example.com/my_app/blogs/1/posts/1#my_anchor" + # + # For all of these options, see the documentation for url_for. + # + # ==== Functionality + # # # an Article record # polymorphic_url(record) # same as article_url(record) # -- cgit v1.2.3