1
0

Reload readouts on current readout name change

This commit is contained in:
cryptogopher 2020-04-03 22:11:23 +02:00
parent 0e8634a3dd
commit a7b003dc6f

View File

@ -52,8 +52,12 @@ class MeasurementsController < ApplicationController
update_routine_from_params
if @measurement.update(measurement_params)
flash[:notice] = 'Updated measurement'
prepare_items
render :index
if @measurement.routine.previous_changes.has_key?(:name) && params[:view] == 'readouts'
render js: "window.location.pathname='#{readouts_measurement_routine_path(@routine)}'"
else
prepare_items
render :index
end
else
render :edit
end