class DynamicScaffold::Form::Item::JSONObject

Attributes

form[R]

Public Class Methods

new(config, type, name, options = {}) { |form| ... } click to toggle source
Calls superclass method DynamicScaffold::Form::Item::Base::new
# File lib/dynamic_scaffold/form/item/json_object.rb, line 6
def initialize(config, type, name, options = {})
  super
  @options = options
  @form = FormBuilder.new(config)
  @form.parent_item = self
  yield(@form)
end

Public Instance Methods

extract_parameters(permitting) click to toggle source
# File lib/dynamic_scaffold/form/item/json_object.rb, line 19
def extract_parameters(permitting)
  hash = permitting.find {|e| e.is_a?(Hash) && e.key?(name) }
  if hash.nil?
    hash = {}
    hash[name] = form.items.map(&:name)
    permitting << hash
  else
    hash[name].concat(form.items.map(&:name))
  end
end
render_label(_view, _depth) click to toggle source

the lable is always empty.

# File lib/dynamic_scaffold/form/item/json_object.rb, line 15
def render_label(_view, _depth)
  ''
end