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 form_hidden_field(column, record, scope)
        options = active_scaffold_input_options(column, scope)
        if column.association&.collection?
          associated = record.send(column.name)
          if associated.blank?
            hidden_field_tag options[:name], '', options
          else
            options[:name] += '[]'
            fields = associated.map do |r|
              hidden_field_tag options[:name], r.id, options.merge(id: options[:id] + "_#{r.id}")
            end
            safe_join fields, ''
          end
        elsif column.association
          hidden_field_tag options[:name], record.send(column.name)&.id, options
        else
          hidden_field :record, column.name, options.merge(object: record)
        end
      end
def form_hidden_field ( column , record , scope ) options = active_scaffold_input_options ( column , scope ) if column . association &. collection? associated = record . send ( column . name ) if associated . blank? hidden_field_tag options [ :name ] , '' , options else options [ :name ] += '[]' fields = associated . map do | r | hidden_field_tag options [ :name ] , r . id , options . merge ( id : options [ :id ] + "_#{r.id}" ) end safe_join fields , '' end elsif column . association hidden_field_tag options [ :name ] , record . send ( column . name ) &. id , options else hidden_field :record , column . name , options . merge ( object : record ) end 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>
record
<not_specific>
scope
<not_specific>