Module: ActiveScaffold::Actions::Delete

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



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

def self.included(base)
  base.before_filter :delete_authorized_filter, :only => [:delete, :destroy]
end

Instance Method Details

#deleteObject

this method is for html mode. it provides “the missing action” (thelucid.com/articles/2006/07/26/simply-restful-the-missing-action). it also gives us delete confirmation for html mode. woo!



9
10
11
12
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/delete.rb', line 9

def delete
  destroy_find_record
  render :action => 'delete'
end

#destroyObject



14
15
16
17
18
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/actions/delete.rb', line 14

def destroy
  return redirect_to(params.merge(:action => :delete)) if request.get?
  do_destroy
  respond_to_action(:destroy)
end