1
0
Fork 0
forked from OpenNeo/impress

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!
This commit is contained in:
Emi Matchu 2024-09-09 18:17:09 -07:00
parent 903fb19d5c
commit d84ab44771

View file

@ -14,7 +14,7 @@ class PetsController < ApplicationController
respond_to do |format| respond_to do |format|
format.html do format.html do
path = destination + @pet.wardrobe_query path = destination + "?" + @pet.wardrobe_query
redirect_to path redirect_to path
end end
@ -38,9 +38,9 @@ class PetsController < ApplicationController
def destination def destination
case (params[:destination] || params[:origin]) case (params[:destination] || params[:origin])
when 'wardrobe' then wardrobe_path + '?' when 'wardrobe' then wardrobe_path
when 'needed_items' then needed_items_path + '?' when 'needed_items' then needed_items_path
else root_path + '#' else root_path
end end
end end