• 要在 Turbo Frame 中实现 loading 状态,你可以使用 JavaScript Emoji Kitchen 在请求开始和结束时显示和隐藏加载指示器。

    html Sao chép mã <!-- Initial content or loading spinner -->

    document.addEventListener("turbo:before-fetch-request", function(event) { if (event.target.id === "my-frame") { // 显示加载指示器 document.getElementById("loading-indicator").style.display = "block"; } }); document.addEventListener("turbo:frame-load", function(event) { if (event.target.id === "my-frame") { // 隐藏加载指示器 document.getElementById("loading-indicator").style.display = "none"; } });
  • Rails JSON logger at 2024年07月31日

    To ensure consistent log formatting in Rails services, especially when working with log services like Kibana, Geometry Dash Lite using a JSON logger is essential. This gem offers a predefined JSON log format specifically tailored for Rails applications. By adding this gem to your Gemfile, you can easily achieve log consistency in your Rails services.