Sha256: 3e0f22fc579d0f033584513e08357b7eacf21af2a9cfa94e6c1f358f441bf90c

Contents?: true

Size: 707 Bytes

Versions: 27

Compression:

Stored size: 707 Bytes

Contents

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

if defined?(SimpleForm)

  class EffectivePanelSelectInput < SimpleForm::Inputs::CollectionSelectInput
    def input(wrapper_options = nil)
      label_method, value_method = (detect_collection_methods rescue [:to_s, :to_s])

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

      Inputs::EffectivePanelSelect::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

27 entries across 27 versions & 1 rubygems

Version Path
effective_form_inputs-1.3.0 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.2.9 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.2.8 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.2.7 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.2.6 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.2.5 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.2.4 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.2.3 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.2.2 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.2.1 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.2.0 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.1.15 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.1.14 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.1.13 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.1.12 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.1.11 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.1.10 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.1.9 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.1.8 app/models/inputs/effective_panel_select_input.rb
effective_form_inputs-1.1.7 app/models/inputs/effective_panel_select_input.rb