Display form errors using custom validity messages

This commit is contained in:
2026-07-28 00:45:08 +02:00
parent 5d051de666
commit eb2797bd90
13 changed files with 81 additions and 51 deletions

View File

@@ -22,7 +22,7 @@ class UnitsController < ApplicationController
@before = @unit.successive
flash.now[:notice] = t('.success', unit: @unit)
else
render :new
render_errors @unit
end
end
@@ -33,7 +33,7 @@ class UnitsController < ApplicationController
if @unit.update(params.except(:base_id).expect(Unit::ATTRIBUTES))
flash.now[:notice] = t('.success', unit: @unit)
else
render :edit
render_errors @unit
end
end