class Array
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
Public Instance Methods
to_query(key)
click to toggle source
# 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