aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/array
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-12-14 18:02:04 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-12-14 18:02:04 +0000
commit7a224356a88f104b6bf012e930721efb2274c2b1 (patch)
tree87752422f27842ef894f873dd490e5816973cc06 /activesupport/lib/active_support/core_ext/array
parent3aa54c5e44f8f0d9e5ed7a346084884ed07b89d0 (diff)
downloadrails-7a224356a88f104b6bf012e930721efb2274c2b1.tar.gz
rails-7a224356a88f104b6bf012e930721efb2274c2b1.tar.bz2
rails-7a224356a88f104b6bf012e930721efb2274c2b1.zip
Added that Array#to_param calls to_param on all it's elements (closes #10473) [brandon]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8384 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/core_ext/array')
-rw-r--r--activesupport/lib/active_support/core_ext/array/conversions.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/conversions.rb b/activesupport/lib/active_support/core_ext/array/conversions.rb
index c828e84112..7574dc13cd 100644
--- a/activesupport/lib/active_support/core_ext/array/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/array/conversions.rb
@@ -24,9 +24,9 @@ module ActiveSupport #:nodoc:
end
end
- # When an array is given to url_for, it is converted to a slash separated string.
+ # Calls to_param on all its elements and joins the result with slashes. This is used by url_for in Action Pack.
def to_param
- join '/'
+ map(&:to_param).join '/'
end
# Converts an array into a string suitable for use as a URL query string, using the given <tt>key</tt> as the