aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/array
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-11-01 11:06:47 +0100
committerJeremy Kemper <jeremy@bitsweat.net>2009-11-02 17:50:12 -0800
commitb540eca5889d7a28fac39c9ec0df715aa89487ce (patch)
tree76a8ef40d8a9e99f1dc36a5b526b9a4c9c62567c /activesupport/lib/active_support/core_ext/array
parent8935854375a6c08acd617beaec30f6fd09a29ea0 (diff)
downloadrails-b540eca5889d7a28fac39c9ec0df715aa89487ce.tar.gz
rails-b540eca5889d7a28fac39c9ec0df715aa89487ce.tar.bz2
rails-b540eca5889d7a28fac39c9ec0df715aa89487ce.zip
Consolidate Object#to_param and #to_query core extensions
Diffstat (limited to 'activesupport/lib/active_support/core_ext/array')
-rw-r--r--activesupport/lib/active_support/core_ext/array/conversions.rb16
1 files changed, 0 insertions, 16 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/conversions.rb b/activesupport/lib/active_support/core_ext/array/conversions.rb
index c53cf3f530..db140225e8 100644
--- a/activesupport/lib/active_support/core_ext/array/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/array/conversions.rb
@@ -40,22 +40,6 @@ class Array
end
end
-
- # Calls <tt>to_param</tt> on all its elements and joins the result with
- # slashes. This is used by <tt>url_for</tt> in Action Pack.
- def to_param
- collect { |e| e.to_param }.join '/'
- end
-
- # Converts an array into a string suitable for use as a URL query string,
- # using the given +key+ as the param name.
- #
- # ['Rails', 'coding'].to_query('hobbies') # => "hobbies%5B%5D=Rails&hobbies%5B%5D=coding"
- def to_query(key)
- prefix = "#{key}[]"
- collect { |value| value.to_query(prefix) }.join '&'
- end
-
# Converts a collection of elements into a formatted string by calling
# <tt>to_s</tt> on all elements and joining them:
#