Sha256: 3ea29805d9000b7fba04c3b9990fb2ed512c50e6afae33a742d4565f2eeaeee2

Contents?: true

Size: 884 Bytes

Versions: 41

Compression:

Stored size: 884 Bytes

Contents

# frozen_string_literal: true

module EacRailsUtils
  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

41 entries across 41 versions & 1 rubygems

Version Path
eac_rails_utils-0.25.0 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.24.0 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.23.4 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.23.3 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.23.2 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.23.1 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.23.0 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.22.3 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.22.2 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.22.1 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.22.0 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.21.0 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.20.0 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.19.0 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.18.0 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.17.2 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.17.1 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.17.0 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.16.0 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
eac_rails_utils-0.15.2 app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb