Skip to content

Commit 428044f

Browse files
Yanchek99claude
andauthored
Add missing edit view and Edit link for logs (#1871)
LogsController#edit/#update, the route, and the shared _form partial already existed, but app/views/logs/edit.html.slim was never added, so visiting the edit URL crashed with a missing-template error. The show page also had no Edit link, so there was no way to reach the page at all. Add the template (mirrors new.html.slim) and an Edit button next to Delete on the show page. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent f93fd3b commit 428044f

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

app/views/logs/edit.html.slim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.container
2+
= render 'form', log: @log

app/views/logs/show.html.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
- @log.movement_logs.each do |ml|
99
.col-12
1010
span = measurable_message(ml)
11-
.mt-2.d-grid
11+
.mt-2.d-grid.gap-2
12+
= link_to 'Edit', edit_workout_log_path(@log.workout, @log), class: 'btn btn-primary'
1213
= link_to 'Delete', log_path(@log), data: { turbo_method: :delete }, class: 'btn btn-danger'

0 commit comments

Comments
 (0)