Module: JsonFields::ApplicationHelper

Included in:
JsonFieldsHelper
Defined in:
lib/json_fields/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#json_field(object_name, method, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/json_fields/application_helper.rb', line 4

def json_field(object_name, method, options = {})
  klass = options[:object].class
  if options[:class].blank?
    options[:class] = 'json-field'
  else
    options[:class] += ' json-field'
  end
  klass.json_fields[method].template(object_name, method, options)
end