Sha256: c2a2cbbb49d0446210e802656967827631967e0e69dc80f918df76af6c0681ce

Contents?: true

Size: 616 Bytes

Versions: 5

Compression:

Stored size: 616 Bytes

Contents

# frozen_string_literal: true
module SimpleForm
  module Inputs
    class PriorityInput < CollectionSelectInput
      def input(wrapper_options = nil)
        merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)

        @builder.send(:"#{input_type}_select", attribute_name, input_priority,
                      input_options, merged_input_options)
      end

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

      protected

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
simple_form-5.1.0 lib/simple_form/inputs/priority_input.rb
simple_form-5.0.3 lib/simple_form/inputs/priority_input.rb
simple_form-5.0.2 lib/simple_form/inputs/priority_input.rb
simple_form-5.0.1 lib/simple_form/inputs/priority_input.rb
simple_form-5.0.0 lib/simple_form/inputs/priority_input.rb