rails8-memoapp/app/javascript/application.js

8 lines
223 B
JavaScript
Raw Normal View History

2025-02-20 22:46:52 +09:00
import { Turbo } from "@hotwired/turbo-rails";
import "controllers";
Turbo.StreamActions.redirect = function () {
const url = this.getAttribute("url") || "/";
Turbo.visit(url, { frame: "_top", action: "advance" });
};