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, #inline_hint, #label, #model, #model_name, #name, #parent, #readonly, #required, #tag, #turbolink, #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
#array_field, #boolean_field, #combo_field, #complex_field, #date_field, #email_field, #file_field, #image_field, #map_field, #number_field, #password_field, #select_field, #subform, #table_field, #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, number_format, #simple_value, singular_name
Constructor Details
#initialize(h = {}) ⇒ SubformField
Returns a new instance of SubformField.
269 270 271 272 273 |
# File 'lib/forma/field.rb', line 269 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.
267 268 269 |
# File 'lib/forma/field.rb', line 267 def form @form end |
Instance Method Details
#edit_element(val) ⇒ Object
275 276 277 278 |
# File 'lib/forma/field.rb', line 275 def edit_element(val) init_forma_before_field_display(true) @form.to_html end |
#view_element(val) ⇒ Object
280 281 282 283 |
# File 'lib/forma/field.rb', line 280 def view_element(val) init_forma_before_field_display(false) @form.to_html end |