Sha256: ea3fa17343b9ae7d330354812bd68724c97017855658a12b4abff0d0527bcc5b

Contents?: true

Size: 667 Bytes

Versions: 24

Compression:

Stored size: 667 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 unless options[:polymorphic]
      options[:value_method] = value_method unless options[:polymorphic]

      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

24 entries across 24 versions & 1 rubygems

Version Path
effective_form_inputs-0.9.0 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.18 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.17 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.16 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.15 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.14 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.13 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.12 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.11 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.10 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.9 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.8 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.7 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.6 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.5 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.4 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.3 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.2 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.1 app/models/inputs/effective_select_input.rb
effective_form_inputs-0.8.0 app/models/inputs/effective_select_input.rb