Sha256: cdcee99a9561d904e1af8f4b75641617ff2594f1a1114f61ab9d886e7a40470e

Contents?: true

Size: 609 Bytes

Versions: 10

Compression:

Stored size: 609 Bytes

Contents

# = simple_form_for @thing do |f|
#   = f.input :category, :as => :effective_select

if defined?(SimpleForm)

  class EffectiveSelectInput < SimpleForm::Inputs::CollectionSelectInput
    def input(wrapper_options = nil)
      label_method, value_method = detect_collection_methods

      options[:collection] = collection
      options[:label_method] = label_method
      options[:value_method] = value_method

      Inputs::EffectiveSelect::Input.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
effective_form_inputs-0.7.3 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.7.2 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.7.1 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.7.0 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.6.4 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.6.3 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.6.2 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.6.1 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.6.0 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.5.0 app/models/inputs/effective_select_input.rb