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:
parent
80c2f9a1df
commit
a1f1f2b728
@ -74,7 +74,7 @@
|
|||||||
<!-- 按钮 -->
|
<!-- 按钮 -->
|
||||||
<div class="card-actions justify-end">
|
<div class="card-actions justify-end">
|
||||||
<%= link_to city_path(city),
|
<%= 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
|
View Details
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<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" />
|
<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">
|
<div class="card-actions justify-end">
|
||||||
<%= link_to city_path(city),
|
<%= 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
|
View Details
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<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" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" />
|
||||||
|
Loading…
Reference in New Issue
Block a user