aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/object/to_param.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-11-21 03:30:06 +0100
committerXavier Noria <fxn@hashref.com>2010-11-21 03:30:06 +0100
commit6af08ab6d835d1c2aa8648a0d3a4a86e678c3f52 (patch)
tree96bd668692b62d3829322232877b70c9011ce446 /activesupport/lib/active_support/core_ext/object/to_param.rb
parentf326221c701e4f9d991e3eadcc793a73795fb218 (diff)
parent7c51d1fcf9dc504c2dfd6e7184bbe8186f09819d (diff)
downloadrails-6af08ab6d835d1c2aa8648a0d3a4a86e678c3f52.tar.gz
rails-6af08ab6d835d1c2aa8648a0d3a4a86e678c3f52.tar.bz2
rails-6af08ab6d835d1c2aa8648a0d3a4a86e678c3f52.zip
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object/to_param.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/object/to_param.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/to_param.rb b/activesupport/lib/active_support/core_ext/object/to_param.rb
index ecb2bca82c..593f376159 100644
--- a/activesupport/lib/active_support/core_ext/object/to_param.rb
+++ b/activesupport/lib/active_support/core_ext/object/to_param.rb
@@ -1,5 +1,3 @@
-
-
class Object
# Alias of <tt>to_s</tt>.
def to_param
@@ -41,7 +39,7 @@ class Hash
# ==== Examples
# { :name => 'David', :nationality => 'Danish' }.to_param # => "name=David&nationality=Danish"
#
- # { :name => 'David', :nationality => 'Danish' }.to_param('user') # => "user[name]=David&user[nationality]=Danish"
+ # { :name => 'David', :nationality => 'Danish' }.to_query('user') # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish"
def to_param(namespace = nil)
collect do |key, value|
value.to_query(namespace ? "#{namespace}[#{key}]" : key)