Module: ActiveScaffold::Actions::Update

Defined in:
lib/active_scaffold/actions/update.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/active_scaffold/actions/update.rb', line 5

def self.included(base)
  if base.active_scaffold_config.model.primary_key.nil?
    raise "#{base.active_scaffold_config.model.name} has no primary key, update won't work"
  end

  base.before_action :update_authorized_filter, only: i[edit update]
  base.helper_method :update_refresh_list?
end

Instance Method Details

#editObject



14
15
16
17
# File 'lib/active_scaffold/actions/update.rb', line 14

def edit
  do_edit
  respond_to_action(:edit)
end

#updateObject



19
20
21
22
# File 'lib/active_scaffold/actions/update.rb', line 19

def update
  do_update
  respond_to_action(:update)
end

#update_columnObject

for inline (inlist) editing



25
26
27
28
# File 'lib/active_scaffold/actions/update.rb', line 25

def update_column
  do_update_column
  @column_span_id = params.delete(:editor_id) || params.delete(:editorId)
end