]> git.openstreetmap.org Git - rails.git/blob - config/initializers/new_framework_defaults_8_1.rb
Reconfigure i18n-js to avoid top-level i18n directory
[rails.git] / config / initializers / new_framework_defaults_8_1.rb
1 # frozen_string_literal: true
2
3 # Be sure to restart your server when you modify this file.
4 #
5 # This file eases your Rails 8.1 framework defaults upgrade.
6 #
7 # Uncomment each configuration one by one to switch to the new default.
8 # Once your application is ready to run with all new defaults, you can remove
9 # this file and set the `config.load_defaults` to `8.1`.
10 #
11 # Read the Guide for Upgrading Ruby on Rails for more info on each option.
12 # https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
13
14 ###
15 # Skips escaping HTML entities and line separators. When set to `false`, the
16 # JSON renderer no longer escapes these to improve performance.
17 #
18 # Example:
19 #   class PostsController < ApplicationController
20 #     def index
21 #       render json: { key: "\u2028\u2029<>&" }
22 #     end
23 #   end
24 #
25 # Renders `{"key":"\u2028\u2029\u003c\u003e\u0026"}` with the previous default, but `{"key":"

<>&"}` with the config
26 # set to `false`.
27 #
28 # Applications that want to keep the escaping behavior can set the config to `true`.
29 #++
30 # Rails.configuration.action_controller.escape_json_responses = false
31
32 ###
33 # Skips escaping LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) in JSON.
34 #
35 # Historically these characters were not valid inside JavaScript literal strings but that changed in ECMAScript 2019.
36 # As such it's no longer a concern in modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset.
37 #++
38 # Rails.configuration.active_support.escape_js_separators_in_json = false
39
40 ###
41 # Raises an error when order dependent finder methods (e.g. `#first`, `#second`) are called without `order` values
42 # on the relation, and the model does not have any order columns (`implicit_order_column`, `query_constraints`, or
43 # `primary_key`) to fall back on.
44 #
45 # The current behavior of not raising an error has been deprecated, and this configuration option will be removed in
46 # Rails 8.2.
47 #++
48 # Rails.configuration.active_record.raise_on_missing_required_finder_order_columns = true
49
50 ###
51 # Controls how Rails handles path relative URL redirects.
52 # When set to `:raise`, Rails will raise an `ActionController::Redirecting::UnsafeRedirectError`
53 # for relative URLs without a leading slash, which can help prevent open redirect vulnerabilities.
54 #
55 # Example:
56 #   redirect_to "example.com"     # Raises UnsafeRedirectError
57 #   redirect_to "@attacker.com"   # Raises UnsafeRedirectError
58 #   redirect_to "/safe/path"      # Works correctly
59 #
60 # Applications that want to allow these redirects can set the config to `:log` (previous default)
61 # to only log warnings, or `:notify` to send ActiveSupport notifications.
62 #++
63 # Rails.configuration.action_controller.action_on_path_relative_redirect = :raise
64
65 ###
66 # Use a Ruby parser to track dependencies between Action View templates
67 #++
68 # Rails.configuration.action_view.render_tracker = :ruby
69
70 ###
71 # When enabled, hidden inputs generated by `form_tag`, `token_tag`, `method_tag`, and the hidden parameter fields
72 # included in `button_to` forms will omit the `autocomplete="off"` attribute.
73 #
74 # Applications that want to keep generating the `autocomplete` attribute for those tags can set it to `false`.
75 #++
76 # Rails.configuration.action_view.remove_hidden_field_autocomplete = true