Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/rezgo/array.rb
Overview
We need to override Array’s to_query to add an index # since ActiveSupport by default does not include one. IE, return: tour_group[1]=Alex&tour_group[1]=Kremer Instead of: tour_group[][first_name]=Alex&tour_group[][last_name]=Kremer
Instance Method Summary collapse
Instance Method Details
#to_query(key) ⇒ Object
5 6 7 |
# File 'lib/rezgo/array.rb', line 5 def to_query(key) to_enum(:each_with_index).collect { |value, index| value.to_query("#{key}[#{index+1}]") }.join('&') end |