Prevent redirection if possible
This will just show the flash message on prevent the browser from changing the location. Works great with Turbolinks!
This commit is contained in:
@ -15,7 +15,7 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def render_not_authorized
|
def render_not_authorized
|
||||||
redirect_to(:root, alert: t('application.not_authorized'))
|
redirect_to(request.referrer || :root, alert: t('application.not_authorized'))
|
||||||
end
|
end
|
||||||
private :render_not_authorized
|
private :render_not_authorized
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user