demarches-normaliennes/app/controllers/champs/siret_controller.rb

14 lines
383 B
Ruby
Raw Normal View History

2018-04-03 17:53:14 +02:00
class Champs::SiretController < ApplicationController
2018-09-06 19:23:27 +02:00
before_action :authenticate_logged_user!
def show
2022-04-28 15:04:21 +02:00
@champ = policy_scope(Champ).find(params[:champ_id])
2023-01-14 10:13:26 +01:00
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
2018-04-03 17:53:14 +02:00
end