Class: Forma::SubformField
- Inherits:
-
SimpleField
- Object
- Field
- SimpleField
- Forma::SubformField
- Includes:
- FieldHelper
- Defined in:
- lib/forma/field.rb
Overview
Subform!
Instance Attribute Summary collapse
-
#form ⇒ Object
readonly
Returns the value of attribute form.
Attributes inherited from Field
#actions, #after, #autofocus, #before, #child_model_name, #height, #hint, #i18n, #icon, #label, #model, #model_name, #name, #parent, #readonly, #required, #tag, #url, #value, #width
Instance Method Summary collapse
- #edit_element(val) ⇒ Object
-
#initialize(h = {}) ⇒ SubformField
constructor
A new instance of SubformField.
- #view_element(val) ⇒ Object
Methods included from FieldHelper
#boolean_field, #combo_field, #complex_field, #date_field, #email_field, #image_field, #map_field, #number_field, #password_field, #select_field, #subform, #text_field
Methods inherited from SimpleField
Methods inherited from Field
#action, #id, #localization_key, #localized_hint, #localized_label, #name_as_chain, #parameter_name, #to_html
Methods included from Html
Methods included from Utils
extract_value, #simple_value, singular_name
Constructor Details
#initialize(h = {}) ⇒ SubformField
Returns a new instance of SubformField.
272 273 274 275 276 |
# File 'lib/forma/field.rb', line 272 def initialize(h = {}) h[:label] = false @form = Form.new(collapsible: true) super(h) end |
Instance Attribute Details
#form ⇒ Object (readonly)
Returns the value of attribute form.
270 271 272 |
# File 'lib/forma/field.rb', line 270 def form @form end |
Instance Method Details
#edit_element(val) ⇒ Object
278 279 280 281 |
# File 'lib/forma/field.rb', line 278 def edit_element(val) init_forma_before_field_display(true) @form.to_html end |
#view_element(val) ⇒ Object
283 284 285 286 |
# File 'lib/forma/field.rb', line 283 def view_element(val) init_forma_before_field_display(false) @form.to_html end |