Gui improvements and ideas

This commit is contained in:
david 2024-07-20 16:52:12 +02:00
parent 3f4c7d17bf
commit 2ae0b55e42
54 changed files with 639 additions and 237 deletions

View file

@ -24,7 +24,7 @@ class ChecklistEntriesController < ApplicationController
@checklist_entry = ChecklistEntry.new(checklist_entry_params)
if @checklist_entry.save
redirect_to @checklist_entry, notice: 'Checklist entry was successfully created.'
redirect_to @checklist_entry.checklist, notice: 'Checklist entry was successfully created.'
else
render :new, status: :unprocessable_entity
end
@ -33,7 +33,8 @@ class ChecklistEntriesController < ApplicationController
# PATCH/PUT /checklist_entries/1
def update
if @checklist_entry.update(checklist_entry_params)
redirect_to @checklist_entry, notice: 'Checklist entry was successfully updated.', status: :see_other
redirect_to @checklist_entry.checklist, notice: 'Checklist entry was successfully updated.',
status: :see_other
else
render :edit, status: :unprocessable_entity
end
@ -42,7 +43,12 @@ class ChecklistEntriesController < ApplicationController
# DELETE /checklist_entries/1
def destroy
@checklist_entry.destroy!
redirect_to checklist_entries_url, notice: 'Checklist entry was successfully destroyed.', status: :see_other
respond_to do |format|
format.html do
redirect_to checklist_entries_url, notice: 'Checklist entry was successfully destroyed.', status: :see_other
end
format.turbo_stream
end
end
private