Module: ActiveScaffold::Actions::Core

Defined in:
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/core.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/core.rb', line 3

def self.included(base)
  base.class_eval do
    after_filter :clear_flashes
  end
end

Instance Method Details

#render_fieldObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/core.rb', line 8

def render_field
  @record = if params[:in_place_editing]
    active_scaffold_config.model.find params[:id]
  else
    active_scaffold_config.model.new
  end
  @update_columns = []
  column = active_scaffold_config.columns[params[:column]]
  if params[:in_place_editing]
    render :inline => "<%= active_scaffold_input_for(active_scaffold_config.columns[params[:update_column].to_sym]) %>"
  elsif !column.nil?
    value = column_value_from_param_value(@record, column, params[:value])
    @record.send "#{column.name}=", value
    @update_columns << Array(params[:update_column]).collect {|column_name| active_scaffold_config.columns[column_name.to_sym]}
    @update_columns.flatten!
    after_render_field(@record, column)
  end
end