def destroy
      authorize_for(action: :destroy,
                    resource: resource.name.underscore.to_sym,
                    object: @object)
      if @object.destroy
        head :no_content, status: :ok
      else
        render json: @object.errors, status: :unprocessable_entity
      end
    end
def destroy
      authorize_for(action: :destroy,
                    resource: resource.name.underscore.to_sym,
                    object: @object)
      if @object.destroy
        head :no_content, status: :ok
      else
        render json: @object.errors, status: :unprocessable_entity
      end
    end
DELETE /:resource/1
 Common behavior for an destroy API endpoint