提交 62ddeaf0 编写于 作者: J Jeremy Kemper

Missed commit. References #10395.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8344 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 2d2fd67b
class Object
# Alias of <tt>to_s</tt>.
def to_param
to_s
end
# Converts an object into a string suitable for use as a URL query string, using the given <tt>key</tt> as the
# param name.
#
# Note: This method is defined as a default implementation for all Objects for Hash#to_query to work.
def to_query(key)
"#{CGI.escape(key.to_s)}=#{CGI.escape(to_param.to_s)}"
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.
先完成此消息的编辑!
想要评论请 注册