aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/array/to_param.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/array/to_param.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/array/to_param.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/to_param.rb b/activesupport/lib/active_support/core_ext/array/to_param.rb
new file mode 100644
index 0000000000..85e91e6b1a
--- /dev/null
+++ b/activesupport/lib/active_support/core_ext/array/to_param.rb
@@ -0,0 +1,12 @@
+module ActiveSupport #:nodoc:
+ module CoreExtensions #:nodoc:
+ module Array #:nodoc:
+ module ToParam #:nodoc:
+ # When an array is given to url_for, it is converted to a slash separated string.
+ def to_param
+ join '/'
+ end
+ end
+ end
+ end
+end