We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b08409 commit 9fd1b24Copy full SHA for 9fd1b24
app/controllers/snippets_controller.rb
@@ -1,6 +1,5 @@
1
class SnippetsController < ApplicationController
2
before_action :authenticate_user!, except: :show
3
- before_action :set_snippet, only: %i(edit_modal destroy)
4
5
DELETE_CONFIRM_TEXT = "Are you sure you want to delete this snippet? You won't be able to undo this.".freeze
6
UNFILE_CONFIRM_TEXT = "Are you sure you want to unfile this snippet? It will be removed from your collection.".freeze
@@ -194,6 +193,8 @@ def update
194
193
end
195
196
def destroy
+ @snippet = Snippet.find(params[:id])
197
+
198
respond_to do |format|
199
format.html do
200
if @snippet.destroy
0 commit comments