/ Published in: Ruby
Credit: http://pragmatig.wordpress.com/2009/04/14/recursive-symbolize_keys/
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
def recursive_symbolize_keys! hash hash.symbolize_keys! hash.values.select{|v| v.is_a? Hash}.each{|h| recursive_symbolize_keys!(h)} end