libraries/helpers.rb
# To convert nested Hash to dot-delimited key. Easier for use in template.
To convert nested Hash to dot-delimited key. Easier for use in template.
To convert nested Hash to dot - delimited key . Easier for use in template .
def flatten_values
    each_with_object({}) do |(k, v), h|
      if v.is_a? Hash
        v.flatten_values.map do |h_k, h_v|
          h["#{k}.#{h_k}".to_sym] = h_v
        end
      else
        h[k] = v
      end
    end
  end
def flatten_values each_with_object ( { } ) do | ( k , v ) , h | if v . is_a? Hash v . flatten_values . map do | h_k , h_v | h [ "#{k}.#{h_k}" . to_sym ] = h_v end else h [ k ] = v end end end
To convert nested Hash to dot-delimited key.
To convert nested Hash to dot - delimited key .