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
|
||||
|
||||
def render_not_authorized
|
||||
redirect_to(:root, alert: t('application.not_authorized'))
|
||||
redirect_to(request.referrer || :root, alert: t('application.not_authorized'))
|
||||
end
|
||||
private :render_not_authorized
|
||||
|
||||
|
Reference in New Issue
Block a user