Class: Glib::JsonUi::ViewBuilder::Fields::DynamicGroup

Inherits:
AbstractField show all
Includes:
Panels::ModelPanel
Defined in:
app/helpers/glib/json_ui/view_builder/fields.rb

Instance Attribute Summary

Attributes included from Panels::ModelPanel

#assoc_order_index, #model_name

Attributes inherited from JsonUiElement

#json, #page

Instance Method Summary collapse

Methods included from Panels::ModelPanel

#field_assert_respond_to, #field_label, #field_name, #field_validation, #field_value, #hint_label, #model, #order_index, #placeholder_label

Methods inherited from AbstractField

#autoValidate, #context, #created, #default_url_options, #determine_value, #hint, #hint_args, #label, #label_args, #name, #placeholder, #placeholder_args, #prop, #validation, #value

Methods inherited from View

component_name

Methods inherited from JsonUiElement

#initialize, #props

Constructor Details

This class inherits a constructor from Glib::JsonUi::JsonUiElement

Instance Method Details

#content(value) ⇒ Object

NOTE: Consider using sub-panel instead (e.g. groupTemplate) views :groupTemplateViews



263
264
265
266
267
268
269
270
271
272
# File 'app/helpers/glib/json_ui/view_builder/fields.rb', line 263

def content(value)
  @delegate_class = Glib::JsonUi::ViewBuilder::Panels::Form
  form = page.current_form

  form.current_dynamic_group = self
  form.nested_associations << self
  value.call(page.content_builder([:template]))
  form.nested_associations.pop
  form.current_dynamic_group = nil
end