From 46cbe742604ebb46cd8653017ccfe68b20546039 Mon Sep 17 00:00:00 2001 From: Jerome Dalbert Date: Thu, 13 Jun 2024 20:40:35 -0700 Subject: [PATCH] Update README.md Replace soft deprecated `redirect_back` with `redirect_back_or_to` --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a6807fd7..daa30138 100644 --- a/README.md +++ b/README.md @@ -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 ``` @@ -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 ```