module Extjsizable::ActiveRecord::ExtJs

Private Instance Methods

wrap_hash_with_brackets(h, model_name) click to toggle source

Wrap with brackets so that {:a => {:b => :c} } becomes to { ‘model’ : {‘b’ : ‘c’} }

# File lib/extjsizable/active_record/extjs.rb, line 74
def wrap_hash_with_brackets(h, model_name)
  h.reduce({}) do |nh, (k, v)|
    nh["#{model_name.to_s}[#{k.to_s}]"] = v
    nh
  end
end