mirror of
https://github.com/github/rails.git
synced 2026-01-30 16:58:15 -05:00
Missed commit. References #10395.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8344 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
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
|
||||
Reference in New Issue
Block a user