github << rails / stimulus / hotwire

Hotwire: data-turbo-action October 15, 2025

With Turbo Drive enabled, the default action is “advance”. This basically just calls history.pushState() in the background which adds a new entry in the browser’s history stack.

# this is the default
<a href="/path" data-turbo-action="advance">Go to path</a>

There’s also the “replace” action which calls history.replaceState(). Doesn’t add a new entry but replaces the existing entry in the history stack instead. Ideal to use on edit forms for example.

<a href="/edit" data-turbo-action="replace">Edit</a>