How to elegantly symbolize_keys for a ‘nested’ hash
There are a few ways to do this There’s a deep_symbolize_keys method in Rails hash.deep_symbolize_keys! As mentioned by @chrisgeeq, there is a deep_transform_keys method that’s available from Rails 4. hash.deep_transform_keys(&:to_sym) There is also a bang ! version to replace the existing object. There is another method called with_indifferent_access. This allows you to access a hash … Read more