Module: Formtastic::InputHelpers

Included in:
Formtastic::Inputs::ArrayInput, Formtastic::Inputs::ListInput
Defined in:
lib/formtastic/input_helpers.rb

Instance Method Summary collapse

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, options = {})
  template.hidden_field_tag(name, value, options.merge(class: input_classes(options)))
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, options = {})
  template.text_field_tag(name, value, options.merge(class: input_classes(options)))
end

#icon_tag(icon_name) ⇒ Object



3
4
5
# File 'lib/formtastic/input_helpers.rb', line 3

def icon_tag(icon_name)
  template.(: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(options)
  classes = 'custom-inputs--input-field'
  classes += ' ' + options[:class] if options[:class]
  classes
end