def update
      authorize_for(action: :update,
                    resource: resource.name.underscore.to_sym,
                    object: @object)
      if @object.update(object_params)
        render json: @object.to_json
      else
        render json: @object.errors, status: :unprocessable_entity
      end
    end
def update
      authorize_for(action: :update,
                    resource: resource.name.underscore.to_sym,
                    object: @object)
      if @object.update(object_params)
        render json: @object.to_json
      else
        render json: @object.errors, status: :unprocessable_entity
      end
    end
PATCH/PUT /:resource/1
 Common behavior for an update API endpoint