Reload readouts on current readout name change
This commit is contained in:
parent
0e8634a3dd
commit
a7b003dc6f
@ -52,8 +52,12 @@ class MeasurementsController < ApplicationController
|
|||||||
update_routine_from_params
|
update_routine_from_params
|
||||||
if @measurement.update(measurement_params)
|
if @measurement.update(measurement_params)
|
||||||
flash[:notice] = 'Updated measurement'
|
flash[:notice] = 'Updated measurement'
|
||||||
prepare_items
|
if @measurement.routine.previous_changes.has_key?(:name) && params[:view] == 'readouts'
|
||||||
render :index
|
render js: "window.location.pathname='#{readouts_measurement_routine_path(@routine)}'"
|
||||||
|
else
|
||||||
|
prepare_items
|
||||||
|
render :index
|
||||||
|
end
|
||||||
else
|
else
|
||||||
render :edit
|
render :edit
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user