Merge pull request #9376 from tchak/feat-public-logo

feat(demarche): expose public logo url
This commit is contained in:
mfo 2023-08-14 08:36:16 +00:00 committed by GitHub
commit 07b67679cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View 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