demarches-normaliennes/app/controllers/champs/siret_controller.rb
2023-02-27 13:45:16 +01:00

13 lines
383 B
Ruby

class Champs::SiretController < ApplicationController
before_action :authenticate_logged_user!
def show
@champ = policy_scope(Champ).find(params[:champ_id])
if @champ.fetch_etablissement!(read_param_value(@champ.input_name, 'value'), current_user)
@siret = @champ.etablissement.siret
else
@siret = @champ.etablissement_fetch_error_key
end
end
end