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 update_columns_options(column, scope, options, force = false)
        record = options[:object]
        subform_controller = controller.class.active_scaffold_controller_for(record.class) if scope
        if @main_columns && (scope.nil? || subform_controller == controller.class)
          form_columns = @main_columns.visible_columns_names
        end
        form_columns ||= current_form_columns(record, scope, subform_controller)
        if force || (form_columns && column.update_columns && (column.update_columns & form_columns).present?)
          url_params = params_for(:action => 'render_field', :column => column.name, :id => record.to_param)
          if nested? && scope
            url_params[:nested] = url_params.slice(:parent_scaffold, :association, nested.param_name)
            url_params = url_params.except(:parent_scaffold, :association, nested.param_name)
          end
          if scope
            url_params[:parent_controller] ||= url_params[:controller].gsub(%r{^/}, '')
            url_params[:controller] = subform_controller.controller_path
            url_params[:scope] = scope
            url_params[:parent_id] = params[:parent_id] || params[:id]
          end
          options[:class] = "#{options[:class]} update_form".strip
          options['data-update_url'] = url_for(url_params)
          options['data-update_send_form'] = column.send_form_on_update_column
          options['data-update_send_form_selector'] = column.options[:send_form_selector] if column.options[:send_form_selector]
        end
        options
      end
def update_columns_options ( column , scope , options , force = false ) record = options [ :object ] subform_controller = controller . class . active_scaffold_controller_for ( record . class ) if scope if @main_columns && ( scope . nil? || subform_controller == controller . class ) form_columns = @main_columns . visible_columns_names end form_columns ||= current_form_columns ( record , scope , subform_controller ) if force || ( form_columns && column . update_columns && ( column . update_columns & form_columns ) . present? ) url_params = params_for ( :action => 'render_field' , :column => column . name , :id => record . to_param ) if nested? && scope url_params [ :nested ] = url_params . slice ( :parent_scaffold , :association , nested . param_name ) url_params = url_params . except ( :parent_scaffold , :association , nested . param_name ) end if scope url_params [ :parent_controller ] ||= url_params [ :controller ] . gsub ( %r{ ^/ } , '' ) url_params [ :controller ] = subform_controller . controller_path url_params [ :scope ] = scope url_params [ :parent_id ] = params [ :parent_id ] || params [ :id ] end options [ :class ] = "#{options[:class]} update_form" . strip options [ 'data-update_url' ] = url_for ( url_params ) options [ 'data-update_send_form' ] = column . send_form_on_update_column options [ 'data-update_send_form_selector' ] = column . options [ :send_form_selector ] if column . options [ :send_form_selector ] end options 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>
scope
<not_specific>
options
<not_specific>
force
<not_specific>