Avoid full page reloads on report#show

This commit is contained in:
david 2024-07-20 22:32:35 +02:00
parent 916b370905
commit c44c9ccaba
7 changed files with 19 additions and 8 deletions

View file

@ -31,7 +31,10 @@ class ElementsController < ApplicationController
@element.success_criteria.create!(title: check.name, description_html: check.success_criterion_html,
level: check.level)
end
redirect_to @element.report, notice: 'Element was successfully created.'
respond_to do |format|
format.html { redirect_to @element.report, notice: 'Element was successfully created.' }
format.turbo_stream
end
else
render :new, status: :unprocessable_entity
end