Thursday, June 04, 2026 4:08:46 AM
> toasts_controller.js
import ApplicationController from "./application_controller";
import * as bootstrap from "bootstrap";

// Connects to data-controller="toasts"
export default class extends ApplicationController {
  static targets = ["toast"];

  connect() {
    setTimeout(
      (toast) => {
        toast.hide();
      },
      7000,
      new bootstrap.Toast(this.toastTarget)
    );
  }
}
All opinions represented herein are my own
- © 2024 - 2026 itsthedevman
- build 4294fb2