fix: add turbo_frame data attribute to buttons

- Update buttons to include data attribute for Turbo frames
- Ensure proper behavior of navigation with turbo-enabled requests

This change enhances the functionality of the buttons by allowing them
 to interact with Turbo frames, improving performance and user
 experience when transitioning between different views on the application.
This commit is contained in:
songtianlun 2025-02-12 14:59:19 +08:00
parent 80c2f9a1df
commit a1f1f2b728

View File

@ -74,7 +74,7 @@
<!-- 按钮 -->
<div class="card-actions justify-end">
<%= link_to city_path(city),
class: "btn btn-primary btn-sm gap-2" do %>
class: "btn btn-primary btn-sm gap-2", data: { turbo_frame: "_top" } do %>
View Details
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" />
@ -114,7 +114,7 @@
<div class="card-actions justify-end">
<%= link_to city_path(city),
class: "btn btn-primary btn-sm gap-2" do %>
class: "btn btn-primary btn-sm gap-2", data: { turbo_frame: "_top" } do %>
View Details
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" />