Class: Array
Overview
typed: true
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#to_param ⇒ Object
14 15 16 |
# File 'lib/extensions.rb', line 14 def to_param collect(&:to_param).join "/" end |
#to_query(key) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/extensions.rb', line 4 def to_query(key) prefix = "#{key}[]" if empty? nil.to_query(prefix) else collect { |value| value.to_query(prefix) }.join "&" end end |