Sha256: 0a54c8474d947fb3a631c5524a1614e556c9b126f3efc39c0de200af62a78665

Contents?: true

Size: 626 Bytes

Versions: 10

Compression:

Stored size: 626 Bytes

Contents

module Faalis::Dashboard::Sections
  module ResourceDestroy

    extend ActiveSupport::Concern

    # The actual action method of a dashboard controller
    def destroy
      @resource = model.find(params[:id])
      authorize @resource

      @resource_title = t(_resource_title.singularize)

      before_destroy_hook(@resource)
      @resource.destroy

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

    private

      # You can override this method to change the behaviour of `destroy`
      # action
      def before_destroy_hook(resource)
      end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
faalis-2.2.0.pre.rc1 lib/faalis/dashboard/sections/resource_destroy.rb
faalis-2.2.1 lib/faalis/dashboard/sections/resource_destroy.rb
faalis-2.2.0 lib/faalis/dashboard/sections/resource_destroy.rb
faalis-2.1.1 lib/faalis/dashboard/sections/resource_destroy.rb
faalis-2.1.0 lib/faalis/dashboard/sections/resource_destroy.rb
faalis-2.0.8 lib/faalis/dashboard/sections/resource_destroy.rb
faalis-2.0.7 lib/faalis/dashboard/sections/resource_destroy.rb
faalis-2.0.5 lib/faalis/dashboard/sections/resource_destroy.rb
faalis-2.0.4 lib/faalis/dashboard/sections/resource_destroy.rb
faalis-2.0.3 lib/faalis/dashboard/sections/resource_destroy.rb