mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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.
This commit is contained in:
parent
3b7192d21e
commit
fa0cff484a
2 changed files with 16 additions and 2 deletions
|
@ -74,6 +74,19 @@ module ActionDispatch
|
||||||
# * <tt>:routing_type</tt> - Allowed values are <tt>:path</tt> or <tt>:url</tt>.
|
# * <tt>:routing_type</tt> - Allowed values are <tt>:path</tt> or <tt>:url</tt>.
|
||||||
# Default is <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
|
# # an Article record
|
||||||
# polymorphic_url(record) # same as article_url(record)
|
# polymorphic_url(record) # same as article_url(record)
|
||||||
#
|
#
|
||||||
|
|
|
@ -92,8 +92,9 @@ module ActionView
|
||||||
# ==== Data attributes
|
# ==== Data attributes
|
||||||
#
|
#
|
||||||
# * <tt>confirm: 'question?'</tt> - This will allow the unobtrusive JavaScript
|
# * <tt>confirm: 'question?'</tt> - This will allow the unobtrusive JavaScript
|
||||||
# driver to prompt with the question specified. If the user accepts, the link is
|
# driver to prompt with the question specified (in this case, the
|
||||||
# processed normally, otherwise no action is taken.
|
# resulting text would be <tt>question?</tt>. If the user accepts, the
|
||||||
|
# link is processed normally, otherwise no action is taken.
|
||||||
# * <tt>:disable_with</tt> - Value of this parameter will be
|
# * <tt>:disable_with</tt> - Value of this parameter will be
|
||||||
# used as the value for a disabled version of the submit
|
# used as the value for a disabled version of the submit
|
||||||
# button when the form is submitted. This feature is provided
|
# button when the form is submitted. This feature is provided
|
||||||
|
|
Loading…
Reference in a new issue