Implement measurements create/destroy and display existing readouts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-02 16:20:59 +00:00
parent d893e59293
commit 5206323d06
6 changed files with 75 additions and 3 deletions

View File

@@ -0,0 +1,11 @@
<% if @readouts.all?(&:persisted?) %>
<%= turbo_stream.update :flashes %>
<%= turbo_stream.remove :measurement_form %>
<%= turbo_stream.enable :new_measurement_link %>
<%= turbo_stream.remove :no_items %>
<% @readouts.each do |readout| %>
<%= turbo_stream.prepend :measurements, readout %>
<% end %>
<% else %>
<%= turbo_stream.update :flashes %>
<% end %>