Class: Ishapi::MeasurementsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/ishapi/measurements_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#home, #long_term_token, #test

Instance Method Details

#updateObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/ishapi/measurements_controller.rb', line 7

def update
  authorize! :update_measurements, CoTailors::Order
  flag = @current_profile.measurement.update_attributes params[:measurement].permit( CoTailors::Order::MEASUREMENT_PARAMS )

  # byebug

  if flag
    render :json => { :status => :ok }
  else
    render :json => { :status => :not_ok, :error => @current_profile.measurement.errors.messages }
  end
end