Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Replace soft deprecated `redirect_back` with `redirect_back_or_to`
  • Loading branch information
jeromedalbert committed Jun 14, 2024
1 parent 7e59b98 commit 46cbe74
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 46cbe74

Please sign in to comment.