ajout du nom d'application tot au demarrage

The application name is used in the views, but also in the initializers and in the config/ directory

According to rails doc (https://guides.rubyonrails.org/v6.0/configuring.html#locations-for-initialization-code),
if we want to do some things before the initializers and the environment, the only place to do so is in config/application.rb
This commit is contained in:
clemkeirua 2020-07-22 09:05:13 +02:00
parent fb3e69aa2a
commit 3340a2b091
3 changed files with 9 additions and 0 deletions

View file

@ -1,6 +1,7 @@
require File.expand_path('boot', __dir__)
require 'rails/all'
require_relative 'application_name'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.

View file

@ -0,0 +1,3 @@
APPLICATION_NAME = ENV.fetch("APPLICATION_NAME", "demarches-simplifiees.fr")
APPLICATION_SHORTNAME = ENV.fetch("APPLICATION_SHORTNAME", "d-s.fr")
APPLICATION_BASE_URL = ENV.fetch("APPLICATION_BASE_URL", "https://www.demarches-simplifiees.fr")

View file

@ -10,6 +10,11 @@ APP_NAME="tps_local"
# * pour de la prod: www.demarches-simplifiees.fr
APP_HOST="localhost:3000"
# Les paramètres pour l'affichage du nom l'application, et pour la génération des liens
APPLICATION_NAME="demarches-simplifiees.fr"
APPLICATION_SHORTNAME="d-s.fr"
APPLICATION_BASE_URL="https://www.demarches-simplifiees.fr"
# Utilisé pour les logs LogRage
SOURCE="tps_local"