Skip to content

Commit

Permalink
Merge pull request #814 from jeromedalbert/redirect-back-or-to
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
Burgestrand authored Jun 16, 2024
2 parents e888328 + 20e0fe5 commit fecc480
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ class ApplicationController < ActionController::Base

def user_not_authorized
flash[:alert] = "You are not authorized to perform this action."
redirect_back(fallback_location: root_path)
redirect_back_or_to(root_path)
end
end
```
Expand Down Expand Up @@ -539,7 +539,7 @@ class ApplicationController < ActionController::Base
policy_name = exception.policy.class.to_s.underscore

flash[:error] = t "#{policy_name}.#{exception.query}", scope: "pundit", default: :default
redirect_back(fallback_location: root_path)
redirect_back_or_to(root_path)
end
end
```
Expand Down

0 comments on commit fecc480

Please sign in to comment.