You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was recently playing with morphing on a Rails application, specifically with a search form which made a GET request to the same index action of the page. I found that morphing was not working unless I defined the attribute data-turbo-action="replace" on the form element.
Going through the source code, I found that Turbo considers a page refresh only when the visit.action is replace.
I was wondering if that made sense, since in the search request I was doing I may want to preserve the current location and push a new one so that I'm able to go back to previous searches, and that is not possible with the replace action.
This problem could also happen when applying filters on an index page as it would have the same form doing a GET request with the filter params to the same index action.
To give some context these were the versions I was working with:
rails -> 7.0.8
turbo-rails -> 2.0.11
The text was updated successfully, but these errors were encountered:
Hi,
I was recently playing with morphing on a Rails application, specifically with a search form which made a GET request to the same
index
action of the page. I found that morphing was not working unless I defined the attributedata-turbo-action="replace"
on the form element.Going through the source code, I found that Turbo considers a page refresh only when the
visit.action
isreplace
.turbo/src/core/drive/page_view.js
Line 59 in ea54ae5
I was wondering if that made sense, since in the search request I was doing I may want to preserve the current location and push a new one so that I'm able to go back to previous searches, and that is not possible with the
replace
action.This problem could also happen when applying filters on an
index
page as it would have the same form doing a GET request with the filter params to the sameindex
action.To give some context these were the versions I was working with:
rails
-> 7.0.8turbo-rails
-> 2.0.11The text was updated successfully, but these errors were encountered: