Class: DrgcmsFormFields::HiddenField
- Inherits:
-
DrgcmsField
- Object
- DrgcmsField
- DrgcmsFormFields::HiddenField
- Defined in:
- app/models/drgcms_form_fields.rb
Overview
Implementation of hidden DRG CMS form field.
Will create hidden_field on form.
Form options:
-
name:
field name -
type:
hidden_field
Form example:
10:
name: im_hidden
type: hidden_field
Instance Attribute Summary
Attributes inherited from DrgcmsField
Instance Method Summary collapse
-
#render ⇒ Object
Render hidden_field field html code.
Methods inherited from DrgcmsField
get_data, #hash_to_options, #initialize, #record_text_for, #ro_standard, #set_initial_value, #set_style, #t
Constructor Details
This class inherits a constructor from DrgcmsFormFields::DrgcmsField
Instance Method Details
#render ⇒ Object
Render hidden_field field html code
305 306 307 308 309 310 |
# File 'app/models/drgcms_form_fields.rb', line 305 def render set_initial_value value = @yaml['html']['value'] ? @yaml['html']['value'] : @record[@yaml['name']] record = record_text_for(@yaml['name']) @parent.hidden_field(record, @yaml['name'], value: value) end |