Preliminary Measurement edit/update
This commit is contained in:
@@ -2,7 +2,7 @@ class MeasurementsController < ApplicationController
|
||||
menu_item :body_trackers
|
||||
|
||||
before_action :find_project_by_project_id, only: [:index, :create]
|
||||
before_action :find_measurement, only: [:destroy, :retake]
|
||||
before_action :find_measurement, only: [:edit, :update, :destroy, :retake]
|
||||
before_action :authorize
|
||||
|
||||
def index
|
||||
@@ -25,6 +25,19 @@ class MeasurementsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
prepare_measurements
|
||||
render :index
|
||||
end
|
||||
|
||||
def update
|
||||
if @measurement.update(measurement_params)
|
||||
flash[:notice] = 'Updated measurement'
|
||||
end
|
||||
prepare_measurements
|
||||
render :index
|
||||
end
|
||||
|
||||
def destroy
|
||||
# FIXME: don't destroy if there are any readout values
|
||||
if @measurement.destroy
|
||||
|
||||
Reference in New Issue
Block a user