Method: Extjsizable::ActiveRecord::ExtJs#wrap_hash_with_brackets

Defined in:
lib/extjsizable/active_record/extjs.rb

#wrap_hash_with_brackets(h, model_name) ⇒ Object

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



69
70
71
72
73
74
# File 'lib/extjsizable/active_record/extjs.rb', line 69

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