Class: ActiveEnum::FormHelpers::SimpleForm::GroupedEnumInput
- Inherits:
-
SimpleForm::Inputs::GroupedCollectionSelectInput
- Object
- SimpleForm::Inputs::GroupedCollectionSelectInput
- ActiveEnum::FormHelpers::SimpleForm::GroupedEnumInput
- Defined in:
- lib/active_enum/form_helpers/simple_form.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ GroupedEnumInput
constructor
A new instance of GroupedEnumInput.
Constructor Details
#initialize(*args) ⇒ GroupedEnumInput
Returns a new instance of GroupedEnumInput.
27 28 29 30 31 32 33 |
# File 'lib/active_enum/form_helpers/simple_form.rb', line 27 def initialize(*args) super raise "Attribute '#{attribute_name}' has no enum class" unless enum = object.class.active_enum_for(attribute_name) [:collection] = enum.to_grouped_select([:group_by]) [:group_method] = :last end |