-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathapplication.rb
89 lines (71 loc) · 3.07 KB
/
application.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
require_relative "boot"
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
# require "active_record/railtie"
# require "active_storage/engine"
require "action_controller/railtie"
require "active_support/time"
# require "action_mailer/railtie"
# require "action_mailbox/engine"
# require "action_text/engine"
require "action_view/railtie"
# require "action_cable/engine"
require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Frontend
class Application < Rails::Application
include GovukPublishingComponents::AppHelpers::AssetHelper
# Initialize configuration defaults for originally generated Rails version.
require "frontend"
config.load_defaults 7.0
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
config.time_zone = "London"
# Custom directories with classes and modules you want to be autoloadable.
config.eager_load_paths += %W[#{config.root}/app/presenters #{config.root}/lib]
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
config.i18n.default_locale = :en
config.i18n.fallbacks = true
config.i18n.available_locales = %i[
en
cy
]
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Enable the asset pipeline
config.assets.enabled = true
config.assets.precompile += %w[
views/travel-advice.js
frontend.js
application.css
]
config.assets.precompile << get_component_css_paths
# Path within public/ where assets are compiled to
config.assets.prefix = "/assets/frontend"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += %i[password postcode]
# Disable Rack::Cache
config.action_dispatch.rack_cache = nil
# Disable Content Negotiation
config.action_dispatch.ignore_accept_header = true
# Override Rails 4 default which restricts framing to SAMEORIGIN.
config.action_dispatch.default_headers = {
"X-Frame-Options" => "ALLOWALL",
}
config.action_controller.allow_forgery_protection = false
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.
# Using a sass css compressor causes a scss file to be processed twice
# (once to build, once to compress) which breaks the usage of "unquote"
# to use CSS that has same function names as SCSS such as max.
# https://github.com/alphagov/govuk-frontend/issues/1350
config.assets.css_compressor = nil
end
end