Sha256: 9508b98c949a010ee57bdf1a3624d0cd7c8a6997d1fadcfd94d8267bdc2f8309

Contents?: true

Size: 511 Bytes

Versions: 7

Compression:

Stored size: 511 Bytes

Contents

module SimpleForm
  module Inputs
    class PriorityInput < CollectionInput
      def input
        @builder.send(:"#{input_type}_select", attribute_name, input_priority,
                      input_options, input_html_options)
      end

      def input_priority
        options[:priority] || SimpleForm.send(:"#{input_type}_priority")
      end

    protected

      def has_required?
        false
      end

      def skip_include_blank?
        super || input_priority.present?
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simple_form-1.5.2 lib/simple_form/inputs/priority_input.rb
simple_form-1.5.1 lib/simple_form/inputs/priority_input.rb
simple_form-1.5.0 lib/simple_form/inputs/priority_input.rb
simple_form-1.4.2 lib/simple_form/inputs/priority_input.rb
simple_form-1.4.1 lib/simple_form/inputs/priority_input.rb
simple_form-1.4.0 lib/simple_form/inputs/priority_input.rb
simple_form-1.3.1 lib/simple_form/inputs/priority_input.rb