Skip to content

Commit

Permalink
apply real time update to quotes total price
Browse files Browse the repository at this point in the history
  • Loading branch information
dalima-dev committed Oct 20, 2024
1 parent 6f22f3c commit 63258c6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/views/line_item_dates/destroy.turbo_stream.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
<%= turbo_stream.remove @line_item_date %>
<%= render_turbo_stream_flash_messages %>
<%= turbo_stream.update dom_id(@quote, :total) do %>
<%= render "quotes/total", quote: @quote %>
<% end %>
3 changes: 3 additions & 0 deletions app/views/line_items/create.turbo_stream.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
<%= render @line_item, quote: @quote, line_item_date: @line_item_date %>
<% end %>
<%= render_turbo_stream_flash_messages %>
<%= turbo_stream.update dom_id(@quote, :total) do %>
<%= render "quotes/total", quote: @quote %>
<% end %>
3 changes: 3 additions & 0 deletions app/views/line_items/destroy.turbo_stream.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
<%= turbo_stream.remove @line_item %>
<%= render_turbo_stream_flash_messages %>
<%= turbo_stream.update dom_id(@quote, :total) do %>
<%= render "quotes/total", quote: @quote %>
<% end %>
3 changes: 3 additions & 0 deletions app/views/line_items/update.turbo_stream.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
<%= render @line_item, quote: @quote, line_item_date: @line_item_date %>
<% end %>
<%= render_turbo_stream_flash_messages %>
<%= turbo_stream.update dom_id(@quote, :total) do %>
<%= render "quotes/total", quote: @quote %>
<% end %>
4 changes: 3 additions & 1 deletion app/views/quotes/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
<%= render @line_item_dates, quote: @quote %>
<% end %>
</main>
<%= render "quotes/total", quote: @quote %>
<%= turbo_frame_tag dom_id(@quote, :total) do %>
<%= render "quotes/total", quote: @quote %>
<% end %>

0 comments on commit 63258c6

Please sign in to comment.