Avoid refreshing whole index on create

This commit is contained in:
2024-12-19 03:46:29 +01:00
parent 55b6ff3248
commit e5cf3dc0ae
3 changed files with 8 additions and 2 deletions

View File

@@ -19,8 +19,8 @@ class UnitsController < ApplicationController
def create
@unit = current_user.units.new(unit_params)
if @unit.save
@before = @unit.successive
flash.now[:notice] = t('.success', unit: @unit)
run_and_render :index
else
render :new
end