aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-09-23 12:13:15 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-09-23 12:13:15 -0300
commitdd13722c264a84e81ce15a6ec168c84d4db460ca (patch)
tree5ca695d9096402272ced916e248dad00b156ead2 /actionpack
parenteec00b8c03273d006aa12505bde32e2a2547b670 (diff)
parentfa0cff484a8f0c99480b7545fc77610009723147 (diff)
downloadrails-dd13722c264a84e81ce15a6ec168c84d4db460ca.tar.gz
rails-dd13722c264a84e81ce15a6ec168c84d4db460ca.tar.bz2
rails-dd13722c264a84e81ce15a6ec168c84d4db460ca.zip
Merge pull request #10773 from wangjohn/link_and_routing_options
Adding documentation and tests to ``polymorphic_url`` and ``link_to``
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/routing/polymorphic_routes.rb13
1 files changed, 13 insertions, 0 deletions
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
# * <tt>:routing_type</tt> - Allowed values are <tt>:path</tt> or <tt>:url</tt>.
# Default is <tt>:url</tt>.
#
+ # Also includes all the options from <tt>url_for</tt>. These include such
+ # things as <tt>:anchor</tt> or <tt>:trailing_slash</tt>. 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 <tt>url_for</tt>.
+ #
+ # ==== Functionality
+ #
# # an Article record
# polymorphic_url(record) # same as article_url(record)
#