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_attribute(column, record, scope = nil, only_value = false, col_class = nil)
        column_options = active_scaffold_input_options(column, scope, :object => record)
        attributes = field_attributes(column, record)
        attributes[:class] = "#{attributes[:class]} #{col_class}" if col_class.present?
        if only_value
          field = content_tag(:span, get_column_value(record, column), column_options.except(:name, :object))
          if column.association.nil? || column.association.belongs_to?
            method = column.association ? column.association.foreign_key : column.name
            field << hidden_field(:record, method, column_options)
          end
        else
          field = active_scaffold_input_for column, scope, column_options
        end
        if field
          field << loading_indicator_tag(:action => :render_field, :id => params[:id]) if column.update_columns
          field << content_tag(:span, column.description, :class => 'description') if column.description.present?
        end
        content_tag :dl, attributes do
          content_tag(:dt, label_tag(label_for(column, column_options), form_column_label(column))) <<
            content_tag(:dd, field)
        end
      end
def form_attribute ( column , record , scope = nil , only_value = false , col_class = nil ) column_options = active_scaffold_input_options ( column , scope , :object => record ) attributes = field_attributes ( column , record ) attributes [ :class ] = "#{attributes[:class]} #{col_class}" if col_class . present? if only_value field = content_tag ( :span , get_column_value ( record , column ) , column_options . except ( :name , :object ) ) if column . association . nil? || column . association . belongs_to? method = column . association ? column . association . foreign_key : column . name field << hidden_field ( :record , method , column_options ) end else field = active_scaffold_input_for column , scope , column_options end if field field << loading_indicator_tag ( :action => :render_field , :id => params [ :id ] ) if column . update_columns field << content_tag ( :span , column . description , :class => 'description' ) if column . description . present? end content_tag :dl , attributes do content_tag ( :dt , label_tag ( label_for ( column , column_options ) , form_column_label ( column ) ) ) << content_tag ( :dd , field ) end end
This method decides which input to use for the given column.
This method decides which input to use for the given column .
# hidden field probably not needed, but leaving it just in case # but it isn't working for assocations which are not belongs_to
column
<not_specific>
record
<not_specific>
scope
<not_specific>
only_value
<not_specific>
col_class
<not_specific>