From: Serguei Cambour Date: 2013-07-21T21:03:45+09:00 Subject: Re: ActiveSupport undercore behaviour I changed as follows and it works for the first nest level for the moment: def format_hash_key(hash) Hash[hash.map {|k, v| [ActiveSupport::Inflector.underscore(k.to_s), v] }] end arr = [] TECHS.each_value do |array_values| array_values.each do |hash| arr << format_hash_key(hash) end end puts arr Output: {"assigned_name"=>"P1", "export_price"=>"USD", "id"=>"1", "delivery"=>"Y", "registered_members"=>[{"Name"=>"Admin", "Id"=>"3", "AvailablePosts"=>[{"Seat"=>"2", "Colour"=>18}, {"Seat"=>"3", "Colour"=>19}, {"Seat"=>"4", "Colour"=>181}, {"Seat"=>"5", "Colour"=>183}]}]} Is there any elegant way to call the same method for other nested levels (values) ? Thank you. -- Posted via http://www.ruby-forum.com/.