Module: ActiveScaffold::Helpers::BatchCreateColumnHelpers
- Defined in:
- lib/active_scaffold/helpers/batch_create_column_helpers.rb
Overview
Helpers that assist with the rendering of a Form Column
Instance Method Summary collapse
-
#active_scaffold_batch_create_by_column(column, scope = nil, options = {}) ⇒ Object
This method decides which input to use for the given column.
- #active_scaffold_batch_create_singular_association(column, html_options) ⇒ Object
Instance Method Details
#active_scaffold_batch_create_by_column(column, scope = nil, options = {}) ⇒ Object
This method decides which input to use for the given column. It does not do any rendering. It only decides which method is responsible for rendering.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/active_scaffold/helpers/batch_create_column_helpers.rb', line 7 def active_scaffold_batch_create_by_column(column, scope = nil, = {}) = (column, scope, ) if column.form_ui == :record_select active_scaffold_record_select(column, , batch_create_by_records, true) else active_scaffold_batch_create_singular_association(column, ) end end |
#active_scaffold_batch_create_singular_association(column, html_options) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/active_scaffold/helpers/batch_create_column_helpers.rb', line 18 def active_scaffold_batch_create_singular_association(column, ) = batch_create_by_records.collect {|r| r.id} = (column.association) .update(column.[:html_options] || {}) = {} .update(column.) [:name] = "#{[:name]}[]" [:multiple] = true select_tag(column.name, (.uniq, ), ) end |