Sha256: dd362fcec428f4184f8cd4da9d1267d344e7ee285fc5812a15ef21eb33307664

Contents?: true

Size: 811 Bytes

Versions: 12

Compression:

Stored size: 811 Bytes

Contents

module SimpleForm
  module Components
    module LabelInput
      extend ActiveSupport::Concern

      included do
        include SimpleForm::Components::Labels
      end

      def label_input(wrapper_options = nil)
        if options[:label] == false
          deprecated_component(:input, wrapper_options)
        else
          deprecated_component(:label, wrapper_options) + deprecated_component(:input, wrapper_options)
        end
      end

      private

      def deprecated_component(namespace, wrapper_options)
        method = method(namespace)

        if method.arity == 0
          ActiveSupport::Deprecation.warn(SimpleForm::CUSTOM_INPUT_DEPRECATION_WARN % { name: namespace })

          method.call
        else
          method.call(wrapper_options)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
simple_form-3.5.0 lib/simple_form/components/label_input.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/simple_form-3.4.0/lib/simple_form/components/label_input.rb
simple_form-3.4.0 lib/simple_form/components/label_input.rb
simple_form-3.3.1 lib/simple_form/components/label_input.rb
simple_form-3.3.0 lib/simple_form/components/label_input.rb
simple_form-3.2.1 lib/simple_form/components/label_input.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/simple_form-3.2.0/lib/simple_form/components/label_input.rb
simple_form-3.2.0 lib/simple_form/components/label_input.rb
simple_form-3.1.1 lib/simple_form/components/label_input.rb
simple_form-3.1.0 lib/simple_form/components/label_input.rb
simple_form-3.1.0.rc2 lib/simple_form/components/label_input.rb
simple_form-3.1.0.rc1 lib/simple_form/components/label_input.rb