Module: Formtastic::InputHelpers
- Included in:
- Formtastic::Inputs::ArrayInput, Formtastic::Inputs::ListInput
- Defined in:
- lib/formtastic/input_helpers.rb
Instance Method Summary collapse
- #ci_hidden_field(name, value = nil, options = {}) ⇒ Object
- #ci_text_field(name, value = nil, options = {}) ⇒ Object
- #icon_tag(icon_name) ⇒ Object
- #input_classes(options) ⇒ Object
Instance Method Details
#ci_hidden_field(name, value = nil, options = {}) ⇒ Object
13 14 15 |
# File 'lib/formtastic/input_helpers.rb', line 13 def ci_hidden_field(name, value = nil, = {}) template.hidden_field_tag(name, value, .merge(class: input_classes())) end |
#ci_text_field(name, value = nil, options = {}) ⇒ Object
17 18 19 |
# File 'lib/formtastic/input_helpers.rb', line 17 def ci_text_field(name, value = nil, = {}) template.text_field_tag(name, value, .merge(class: input_classes())) end |
#icon_tag(icon_name) ⇒ Object
3 4 5 |
# File 'lib/formtastic/input_helpers.rb', line 3 def icon_tag(icon_name) template.content_tag(:i, '', class: "fa fa-#{icon_name}") end |
#input_classes(options) ⇒ Object
7 8 9 10 11 |
# File 'lib/formtastic/input_helpers.rb', line 7 def input_classes() classes = 'custom-inputs--input-field' classes += ' ' + [:class] if [:class] classes end |