module DeleteableActions

Public Instance Methods

delete() click to toggle source
# File lib/deleteable.rb, line 39
def delete
  destroy
end
destroy() click to toggle source
# File lib/deleteable.rb, line 43
def destroy
  thing = self.class.name.gsub(/s?Controller$/,'').constantize.find(params[:id])
  thing.delete
  redirect_to(action: :index)
end
undelete() click to toggle source

:nocov: - not currently supported

# File lib/deleteable.rb, line 50
def undelete
  thing = self.class.name.gsub(/s?Controller$/,'').constantize.find(params[:id])
  thing.undelete
  redirect_to(action: :index)
end