I have this array coming from my server. Which is returned like this when i use puts:
formatted_total_price £66.00 formatted_total_price &am
a = Array.new price1.each do |p| a.merge({p[0] => p[1]}) end render json: a.to_json
or simply you can do
price1.map{|a| { a[0] => a[1] } }.to_json