Resting Pug logo Resting Pug

Description

Creates a chain of methods for deleting a subject

Tip

Override this method to add or remove methods executed while deleting a subject

Used in

Use

Example

class BooksController < ApplicationController
  include RestingPug::Base

  private
  # Override a destroy chain adding logging to the end
  def destroy_chain
    super + [:log_destroying_subject]
  end
end

Source code

# lib/resting_pug/chains.rb

def destroy_chain
  [:fetch_subject, :destroy_subject]
end
Find me on GitHub