Module: Faalis::Dashboard::Sections::ResourceDestroy

Extended by:
ActiveSupport::Concern
Included in:
DSL
Defined in:
lib/faalis/dashboard/sections/resource_destroy.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) before_destroy_hook(resource) (private)

You can override this method to change the behaviour of destroy action



24
25
# File 'lib/faalis/dashboard/sections/resource_destroy.rb', line 24

def before_destroy_hook(resource)
end

- (Object) destroy

The actual action method of a dashboard controller



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/faalis/dashboard/sections/resource_destroy.rb', line 7

def destroy
  @resource = model.find(params[:id])
  authorize @resource

  @resource_title = _resource_title.singularize

  before_destroy_hook(@resource)
  @resource.destroy

  return if _override_views.include? :destroy
  render 'faalis/dashboard/resource/destroy'
end