feat(demarche): expose public logo url
This commit is contained in:
parent
a4b8ad8f3c
commit
7c3ca54e18
2 changed files with 19 additions and 0 deletions
17
app/controllers/procedures_controller.rb
Normal file
17
app/controllers/procedures_controller.rb
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
class ProceduresController < ApplicationController
|
||||||
|
before_action :retrieve_procedure
|
||||||
|
|
||||||
|
def logo
|
||||||
|
if @procedure.logo.attached?
|
||||||
|
redirect_to url_for(@procedure.logo.variant(:email))
|
||||||
|
else
|
||||||
|
redirect_to image_url(PROCEDURE_DEFAULT_LOGO_SRC)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def retrieve_procedure
|
||||||
|
@procedure = Procedure.find(params[:id])
|
||||||
|
end
|
||||||
|
end
|
|
@ -351,6 +351,8 @@ Rails.application.routes.draw do
|
||||||
delete 'france_connect_information' => 'profil#destroy_fci'
|
delete 'france_connect_information' => 'profil#destroy_fci'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
get 'procedures/:id/logo', to: 'procedures#logo', as: :procedure_logo
|
||||||
|
|
||||||
#
|
#
|
||||||
# Expert
|
# Expert
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue