def repair_nested_params(obj)
      return unless obj.respond_to?(:each)
      obj.each do |key, value|
        if value.is_a?(ActionController::Parameters) || value.is_a?(Hash)
          # If any non-integer keys
          if value.keys.find { |k, _| k =~ /\D/ }
            repair_nested_params(value)
          else
            obj[key] = value.values
            value.values.each { |h| repair_nested_params(h) }
          end
        end
      end
    end
def repair_nested_params(obj)
      return unless obj.respond_to?(:each)
      obj.each do |key, value|
        if value.is_a?(ActionController::Parameters) || value.is_a?(Hash)
          # If any non-integer keys
          if value.keys.find { |k, _| k =~ /\D/ }
            repair_nested_params(value)
          else
            obj[key] = value.values
            value.values.each { |h| repair_nested_params(h) }
          end
        end
      end
    end
rails can't deal with array indices in params (converts them to hashes)
 see https://gist.github.com/bloudermilk/2884947