Class: IndentedCollectionSelectInput
- Inherits:
-
SimpleForm::Inputs::CollectionSelectInput
- Object
- SimpleForm::Inputs::CollectionSelectInput
- IndentedCollectionSelectInput
- Defined in:
- app/inputs/indented_collection_select_input.rb
Instance Method Summary collapse
Instance Method Details
#input ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'app/inputs/indented_collection_select_input.rb', line 2 def input label_method, value_method = detect_collection_methods collection.map! do |o| depth_method = [:depth_method] || :depth spacing = ([:spacing] || 3).to_i label = "\u202f" * spacing * o.send(depth_method) + o.send(label_method) [label, o.send(value_method)] end super end |