-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapplication.rb
More file actions
56 lines (44 loc) · 2.14 KB
/
application.rb
File metadata and controls
56 lines (44 loc) · 2.14 KB
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
require_relative "boot"
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 TemplateApplicationRails
class Application < Rails::Application
config.eager_load = true if Rails.env.development?
# Internationalization
I18n.available_locales = [ :"en", :"es-US" ]
I18n.default_locale = :"en"
I18n.enforce_available_locales = true
# Support nested locale files
config.i18n.load_path += Dir[Rails.root.join("config", "locales", "**", "*.{rb,yml}")]
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.2
# Please, add to the `ignore` list any other `lib` subdirectories that do
# not contain `.rb` files, or that should not be reloaded or eager loaded.
# Common ones are `templates`, `generators`, or `middleware`, for example.
config.autoload_lib(ignore: %w[assets tasks generators])
# Prevent the form_with helper from wrapping input and labels with separate
# div elements when an error is present, since this breaks USWDS styling
# and functionality.
config.action_view.field_error_proc = Proc.new { |html_tag, instance|
html_tag
}
# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files
# in config/environments, which are processed later.
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")
config.generators do |g|
g.factory_bot suffix: "factory"
end
# Support UUID generation. This was a callout in the ActiveStorage guide
# https://edgeguides.rubyonrails.org/active_storage_overview.html#setup
Rails.application.config.generators { |g| g.orm :active_record, primary_key_type: :uuid }
# Show a 403 Forbidden error page when Pundit raises a NotAuthorizedError
config.action_dispatch.rescue_responses["Pundit::NotAuthorizedError"] = :forbidden
config.auth_provider = ENV["USE_DEVISE"] == "true" ? :devise : :cognito
end
end