Skip to content

Instantly share code, notes, and snippets.

@erubboli
Created March 31, 2011 10:53
Show Gist options
  • Save erubboli/896170 to your computer and use it in GitHub Desktop.
Save erubboli/896170 to your computer and use it in GitHub Desktop.
def destroy
@journal = current_user.journals.find(params[:id])
begin
Page.skip_callback(:save, :after, :run_rendering)
Page.skip_callback(:destroy, :before, :remove_from_list)
@journal.destroy
ensure
Page.set_callback(:save, :after, :run_rendering)
Page.set_callback(:destroy, :before, :remove_from_list)
end
respond_with @journal
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment