Class: AgileFormFields::HiddenField
- Inherits:
-
AgileFormField
- Object
- AgileFormField
- AgileFormFields::HiddenField
- Defined in:
- app/models/agile_form_fields/hidden_field.rb
Overview
Implementation of hidden AgileRails 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 AgileFormField
Instance Method Summary collapse
-
#render ⇒ Object
Render hidden_field AgileRails form field code.
Methods inherited from AgileFormField
get_data, #hash_to_options, #html, #initialize, #options_to_hash, #record_text_for, #ro_standard, #set_css_code, #set_default_value, #set_initial_value, #set_style, #t
Constructor Details
This class inherits a constructor from AgileFormFields::AgileFormField
Instance Method Details
#render ⇒ Object
Render hidden_field AgileRails form field code
43 44 45 46 47 48 |
# File 'app/models/agile_form_fields/hidden_field.rb', line 43 def render set_initial_value value = @yaml['html']['value'] ? @yaml['html']['value'] : @record.send(@yaml['name']) record = record_text_for(@yaml['name']) @env.hidden_field(record, @yaml['name'], value: value) end |