[openstreetmap/openstreetmap-website] Allow users to delete their own accounts (PR #3398)

Andy Allan notifications at github.com
Thu Feb 10 09:15:28 UTC 2022


@gravitystorm commented on this pull request.



> @@ -349,7 +349,7 @@ def deny_access(_exception)
     elsif current_user
       set_locale
       respond_to do |format|
-        format.html { redirect_to :controller => "errors", :action => "forbidden" }
+        format.html { redirect_to :controller => "/errors", :action => "forbidden" }

The controller names are a bit more complex than it first appears! So if you are in a namespaced controller (e.g. `Account::DeletionsController`) then `redirect_to :controller => "errors"` means redirecting to `Account::ErrorsController`. I guess this makes some sense in some places but it's not what we want here. Using the forward slash is the equivalent of using the `::` prefix for ruby class names (e.g. ::File), so it makes sure the redirection is to `ErrorsController` regardless of any namespacing in the requesting controller.

This is all irrelevant if we used named paths everywhere, but that's still a work in progress and we don't yet have named paths for the errors controller.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3398#discussion_r803454775
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/3398/review/878535430 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220210/c2b942b2/attachment.htm>


More information about the rails-dev mailing list