forked from ifmeorg/ifme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplication.rb
64 lines (52 loc) · 2.16 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
# frozen_string_literal: true
require_relative 'boot'
require_relative 'locale'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Ifme
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0
# 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.
# 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 = 'Central Time (US & Canada)'
# 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.exceptions_app = routes
config.autoload_paths << Rails.root.join('lib')
config.action_view.field_error_proc = proc { |html_tag|
if html_tag.to_s.include?('label')
%(<div class="errorField">#{html_tag}</div>).html_safe
else
html_tag.to_s.html_safe
end
}
config.action_dispatch.default_headers = {
'X-Frame-Options' => 'SAMEORIGIN',
'X-XSS-Protection' => '1; mode=block',
'X-Content-Type-Options' => 'nosniff',
'X-Download-Options' => 'noopen',
'X-Permitted-Cross-Domain-Policies' => 'none',
'Referrer-Policy' => 'strict-origin-when-cross-origin',
'Strict-Transport-Security' => 'max-age=31536000'
}
config.middleware.use Rack::Deflater,
include: %w[text/html application/json image/svg+xml]
config.i18n.available_locales = Locale.available_locales.sort_by(&:swapcase).map &:to_sym
config.i18n.default_locale = :en
config.to_prepare do
Devise::Mailer.layout 'mailer'
end
end
end