File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ class ApplicationController < ActionController::Base
33 serialization_scope :view_context
44 before_action :configure_permitted_parameters , if : :devise_controller?
55
6- UNAUTHORIZED = 'You do not have access this page' . freeze
6+ UNAUTHORIZED = 'You do not have access to this page' . freeze
77
88 protected
99
Original file line number Diff line number Diff line change @@ -182,7 +182,13 @@ def destroy
182182 flash [ :alert ] = 'Unable to delete snippet'
183183 end
184184
185- redirect_to URI ( request . referrer ) . path
185+ redirect_path = if URI ( request . referrer ) . path == snippet_path ( @snippet )
186+ snippets_path
187+ else
188+ URI ( request . referrer ) . path
189+ end
190+
191+ redirect_to redirect_path
186192 end
187193
188194 format . json do
You can’t perform that action at this time.
0 commit comments