Class: GroupedCollectionSelectInput
- Inherits:
-
SimpleForm::Inputs::GroupedCollectionSelectInput
- Object
- SimpleForm::Inputs::GroupedCollectionSelectInput
- GroupedCollectionSelectInput
- Defined in:
- app/inputs/grouped_collection_select_input.rb
Overview
A saner alternative to SimpleForm’s :grouped_select input type makandracards.com/makandra/25205-a-saner-alternative-to-simpleform-s-grouped_select-input-type
Instance Method Summary collapse
Instance Method Details
#input(wrapper_options = nil) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/inputs/grouped_collection_select_input.rb', line 5 def input( = nil) group_by = .delete(:group_by) if group_by grouped_collection = [:collection].group_by(&group_by) [:collection] = grouped_collection [:group_method] = :last [:group_label_method] = :first end super end |