Module: ActiveScaffold::Bridges::Chosen::Helpers::FormColumnHelpers
- Defined in:
- lib/active_scaffold/bridges/chosen/helpers.rb
Instance Method Summary collapse
-
#active_scaffold_input_chosen(column, html_options, ui_options: column.options) ⇒ Object
requires RecordSelect plugin to be installed and configured.
Instance Method Details
#active_scaffold_input_chosen(column, html_options, ui_options: column.options) ⇒ Object
requires RecordSelect plugin to be installed and configured.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/active_scaffold/bridges/chosen/helpers.rb', line 13 def active_scaffold_input_chosen(column, , ui_options: column.) [:class] << ' chosen' if column.association&.collection? record = .delete(:object) , = (column, record) = {selected: .collect(&:id), include_blank: as_(:_select_), object: record} .update(multiple: true).update([:html_options] || {}) .update() active_scaffold_select_name_with_multiple if (optgroup = .delete(:optgroup)) select(:record, column.name, (column, , optgroup), , ) else collection_select(:record, column.name, , :id, [:label_method] || :to_label, , ) end else active_scaffold_input_select(column, , ui_options: ) end end |