-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implements turbo frames and turbo stream to quotes crud
- Loading branch information
1 parent
134f5b3
commit 869c342
Showing
7 changed files
with
38 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
<div class="quote"> | ||
<%= link_to quote.name, quote_path(quote) %> | ||
<div class="quote__actions"> | ||
<%= button_to "Delete", | ||
quote_path(quote), | ||
method: :delete, | ||
<%= turbo_frame_tag quote do %> | ||
<div class="quote"> | ||
<%= link_to quote.name, | ||
quote_path(quote), | ||
data: { turbo_frame: "_top" } %> | ||
<div class="quote__actions"> | ||
<%= button_to "Delete", | ||
quote_path(quote), | ||
method: :delete, | ||
class: "btn btn--light" %> | ||
<%= link_to "Edit", | ||
edit_quote_path(quote), | ||
class: "btn btn--light" %> | ||
<%= link_to "Edit", | ||
edit_quote_path(quote), | ||
class: "btn btn--light" %> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<%= turbo_stream.prepend "quotes", @quote %> | ||
<%= turbo_stream.update Quote.new, "" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%= turbo_stream.remove @quote %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters