Class: ActiveEnum::FormHelpers::SimpleForm::EnumInput
- Inherits:
-
SimpleForm::Inputs::CollectionSelectInput
- Object
- SimpleForm::Inputs::CollectionSelectInput
- ActiveEnum::FormHelpers::SimpleForm::EnumInput
- Defined in:
- lib/active_enum/form_helpers/simple_form.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ EnumInput
constructor
A new instance of EnumInput.
Constructor Details
#initialize(*args) ⇒ EnumInput
Returns a new instance of EnumInput.
19 20 21 22 23 |
# File 'lib/active_enum/form_helpers/simple_form.rb', line 19 def initialize(*args) super raise "Attribute '#{attribute_name}' has no enum class" unless enum = object.class.active_enum_for(attribute_name) [:collection] = enum.to_select end |