key_values = { :key1 => "value1", :key2 => "value2" } key_values.map{|entry| entry * '='} * '&' #key1=value1&key2=value2