From d84ab44771305bbaeb26ef4af41a7b72aea5912e Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Mon, 9 Sep 2024 18:17:09 -0700 Subject: [PATCH] Fix response when modeling pet from Modeling Hub homepage form This was always modeling correctly, but not showing the message, because Turbo doesn't handle anchors in redirect URLs the same way the browser's full page loads do. I forget why we had this as a `#` URL anyway to begin with. Use `?` instead! --- app/controllers/pets_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/pets_controller.rb b/app/controllers/pets_controller.rb index f4d8e19e..61c44f41 100644 --- a/app/controllers/pets_controller.rb +++ b/app/controllers/pets_controller.rb @@ -14,7 +14,7 @@ class PetsController < ApplicationController respond_to do |format| format.html do - path = destination + @pet.wardrobe_query + path = destination + "?" + @pet.wardrobe_query redirect_to path end @@ -38,9 +38,9 @@ class PetsController < ApplicationController def destination case (params[:destination] || params[:origin]) - when 'wardrobe' then wardrobe_path + '?' - when 'needed_items' then needed_items_path + '?' - else root_path + '#' + when 'wardrobe' then wardrobe_path + when 'needed_items' then needed_items_path + else root_path end end