Sha256: e1f9af4ec8c4e0762477fb4c2ae8f2b6ef4d29864c506d15ce2b741201336278

Contents?: true

Size: 722 Bytes

Versions: 3

Compression:

Stored size: 722 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]

      Effective::FormBuilderInputs::EffectivePanelSelect.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

3 entries across 3 versions & 1 rubygems

Version Path
effective_form_inputs-1.5.0 lib/effective_form_inputs/inputs/effective_panel_select_input.rb
effective_form_inputs-1.4.1 lib/effective_form_inputs/inputs/effective_panel_select_input.rb
effective_form_inputs-1.4.0 lib/effective_form_inputs/inputs/effective_panel_select_input.rb