Fixed link_to documentation references nonexistent URL #573

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@863 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 1019bf15
......@@ -5,7 +5,8 @@ module Helpers
# synchronously, so link_to uses that same url as is generated by url_for, which again is the same url used for
# redirection in redirect_to.
module UrlHelper
# Returns the URL for the set of +options+ provided. See the valid options in link:classes/ActionController/Base.html#M000021
# Returns the URL for the set of +options+ provided. This takes the same options
# as url_for. For a list, see the url_for documentation in link:classes/ActionController/Base.html#M000079.
def url_for(options = {}, *parameters_for_method_reference)
if Hash === options then options = { :only_path => true }.update(options.stringify_keys) end
@controller.send(:url_for, options, *parameters_for_method_reference)
......@@ -32,10 +33,11 @@ def link_to(name, options = {}, html_options = nil, *parameters_for_method_refer
end
end
# Creates a link tag on the image residing at the +src+ using an URL created by the set of +options+. See the valid options in
# link:classes/ActionController/Base.html#M000021. It's also possible to pass a string instead of an options hash to
# get a link tag that just points without consideration. The <tt>html_options</tt> works jointly for the image and ahref tag by
# letting the following special values enter the options on the image and the rest goes to the ahref:
# Creates a link tag on the image residing at the +src+ using an URL created by the set of +options+. This takes the same options
# as url_for. For a list, see the url_for documentation in link:classes/ActionController/Base.html#M000079.
# It's also possible to pass a string instead of an options hash to get a link tag that just points without consideration.
# The <tt>html_options</tt> works jointly for the image and ahref tag by letting the following special values enter the options on
# the image and the rest goes to the ahref:
#
# * <tt>:alt</tt> - If no alt text is given, the file name part of the +src+ is used (capitalized and without the extension)
# * <tt>:size</tt> - Supplied as "XxY", so "30x45" becomes width="30" and height="45"
......@@ -157,4 +159,4 @@ def convert_confirm_option_to_javascript!(html_options)
end
end
end
end
end
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册