lib/active_scaffold/helpers/form_column_helpers.rb
# 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.
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.
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 .
def active_scaffold_input_singular_association(column, html_options, options = {})
        record = html_options.delete(:object)
        associated = record.send(column.association.name)
        select_options = sorted_association_options_find(column.association, nil, record)
        select_options.unshift(associated) unless associated.nil? || select_options.include?(associated)
        method = column.name
        options.merge! :selected => associated&.id, :include_blank => as_(:_select_), :object => record
        html_options.merge!(column.options[:html_options] || {})
        options.merge!(column.options)
        active_scaffold_select_name_with_multiple html_options
        active_scaffold_translate_select_options(options)
        html =
          if (optgroup = options.delete(:optgroup))
            select(:record, method, active_scaffold_grouped_options(column, select_options, optgroup), options, html_options)
          else
            collection_select(:record, method, select_options, :id, column.options[:label_method] || :to_label, options, html_options)
          end
        html << active_scaffold_refresh_link(column, html_options, record) if column.options[:refresh_link]
        html << active_scaffold_new_record_subform(column, record, html_options) if column.options[:add_new]
        html
      end
def active_scaffold_input_singular_association ( column , html_options , options = { } ) record = html_options . delete ( :object ) associated = record . send ( column . association . name ) select_options = sorted_association_options_find ( column . association , nil , record ) select_options . unshift ( associated ) unless associated . nil? || select_options . include? ( associated ) method = column . name options . merge! :selected => associated &. id , :include_blank => as_ ( :_select_ ) , :object => record html_options . merge! ( column . options [ :html_options ] || { } ) options . merge! ( column . options ) active_scaffold_select_name_with_multiple html_options active_scaffold_translate_select_options ( options ) html = if ( optgroup = options . delete ( :optgroup ) ) select ( :record , method , active_scaffold_grouped_options ( column , select_options , optgroup ) , options , html_options ) else collection_select ( :record , method , select_options , :id , column . options [ :label_method ] || :to_label , options , html_options ) end html << active_scaffold_refresh_link ( column , html_options , record ) if column . options [ :refresh_link ] html << active_scaffold_new_record_subform ( column , record , html_options ) if column . options [ :add_new ] html end
This method decides which input to use for the given column.
This method decides which input to use for the given column .
column
<not_specific>
html_options
<not_specific>
options
<not_specific>