Sha256: bcbcc60c77729e3f33bb52718ac093c069a25504feb0ad310411be3ad60681d5

Contents?: true

Size: 875 Bytes

Versions: 16

Compression:

Stored size: 875 Bytes

Contents

# frozen_string_literal: true
module Eac
  module CommonFormHelper
    class FormBuilder
      module CommonTextFields
        %w(email password text).each do |t|
          class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
            def #{t}_field(field_name, options = {})  # def text_field(field_name, options = {})
              field(field_name, options) do           #   field(field_name, options) do
                input_options = options[:input_options] || {}
                input_options[:class] ||= 'form-control'
                @form.#{t}_field(field_name,          #     @form.text_field(field_name,
                  input_options)              #       class: 'form-control')
              end                                     #   end
            end                                       # end
            RUBY_EVAL
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
eac_rails_utils-0.8.0 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.7.1 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.7.0 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.6.0 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.5.0 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.4.0 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.3.0 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.2.2 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.2.1 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.2.0 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.1.15 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.1.14 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.1.13 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.1.12 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.1.11 lib/eac/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.1.10 lib/eac/common_form_helper/form_builder/common_text_fields.rb