demarches-normaliennes/app/controllers/api/v1/procedures_controller.rb
Xavier J 2a6da54320 add gem api-pie
Error : stack level too deep
2016-02-22 19:42:47 +01:00

24 lines
593 B
Ruby

class API::V1::ProceduresController < APIController
api :GET, '/procedures/:id', 'Informations concernant une procédure'
param :id, Integer, desc: "L'identifiant de la procédure", required: true
error code: 401, desc: "Non authorisé"
error code: 404, desc: "Procédure inconnue"
description <<-EOS
Plop
EOS
meta champs: {
}
def show
@procedure = current_administrateur.procedures.find(params[:id]).decorate
render json: @procedure
rescue ActiveRecord::RecordNotFound => e
Rails.logger.error(e.message)
render json: {}, status: 404
end
end