Sha256: 63f53c3237d33e9146427bb318731980b42ff39f8a9b25f2f7c8ef35c304553e

Contents?: true

Size: 618 Bytes

Versions: 5

Compression:

Stored size: 618 Bytes

Contents

module Formtastic
  module InputHelpers
    def icon_tag(icon_name)
      template.content_tag(:i, '', class: "fa fa-#{icon_name}")
    end

    def input_classes(options)
      classes = 'custom-inputs--input-field'
      classes += ' ' + options[:class] if options[:class]
      classes
    end

    def ci_hidden_field(name, value = nil, options = {})
      template.hidden_field_tag(name, value, options.merge(class: input_classes(options)))
    end

    def ci_text_field(name, value = nil, options = {})
      template.text_field_tag(name, value, options.merge(class: input_classes(options)))
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
custom_inputs-0.1.4 lib/formtastic/input_helpers.rb
custom_inputs-0.1.3 lib/formtastic/input_helpers.rb
custom_inputs-0.1.2 lib/formtastic/input_helpers.rb
custom_inputs-0.1.1 lib/formtastic/input_helpers.rb
custom_inputs-0.1.0 lib/formtastic/input_helpers.rb