lundi 14 décembre 2015

Nested dynamic array rails

I have created an array

steps = [{'title' =>'abc','content' =>'click this', 'target' => 'bca'}]
tours = ['id'=>'tour', 'steps:' => "#{steps}"]
puts tours 

Getting following output :

{"id"=>"tour", "steps:"=>"[{\"title\"=>\"abc\", \"content\"=>\"click this\", \"target\"=>\"bca\"}]"}

The structure of the output is right but i don't want these \ in the output. What should i do to remove these \. Thanks!

Aucun commentaire:

Enregistrer un commentaire