Skip to content

Commit f0d66d6

Browse files
authored
Merge pull request rails#50279 from skipkayhil/hm-nfd-2
More improvements to new framework defaults doc [ci-skip]
2 parents c5a8621 + d3d327b commit f0d66d6

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

guides/source/configuring.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,8 +1794,19 @@ updated via an `around_filter`. The default value is `true`.
17941794

17951795
#### `config.action_controller.wrap_parameters_by_default`
17961796

1797-
Configures the [`ParamsWrapper`](https://api.rubyonrails.org/classes/ActionController/ParamsWrapper.html) to wrap json
1798-
request by default.
1797+
Before Rails 7.0, new applications were generated with an initializer named
1798+
`wrap_parameters.rb` that enabled parameter wrapping in `ActionController::Base`
1799+
for JSON requests.
1800+
1801+
Setting this configuration value to `true` has the same behavior as the
1802+
initializer, allowing applications to remove the initializer if they do not wish
1803+
to customize parameter wrapping behavior.
1804+
1805+
Regardless of this value, applications can continue to customize the parameter
1806+
wrapping behavior as before in an initializer or per controller.
1807+
1808+
See [`ParamsWrapper`][params_wrapper] for more information on parameter
1809+
wrapping.
17991810

18001811
The default value depends on the `config.load_defaults` target version:
18011812

@@ -1804,6 +1815,8 @@ The default value depends on the `config.load_defaults` target version:
18041815
| (original) | `false` |
18051816
| 7.0 | `true` |
18061817

1818+
[params_wrapper]: https://api.rubyonrails.org/classes/ActionController/ParamsWrapper.html
1819+
18071820
#### `ActionController::Base.wrap_parameters`
18081821

18091822
Configures the [`ParamsWrapper`](https://api.rubyonrails.org/classes/ActionController/ParamsWrapper.html). This can be called at
@@ -2128,7 +2141,21 @@ The default value depends on the `config.load_defaults` target version:
21282141
21292142
#### `config.action_view.button_to_generates_button_tag`
21302143
2131-
Determines whether `button_to` will render `<button>` element, regardless of whether or not the content is passed as the first argument or as a block.
2144+
When `false`, `button_to` will render a `<button>` or an `<input>` inside a
2145+
`<form>` depending on how content is passed (`<form>` omitted for brevity):
2146+
2147+
```erb
2148+
<%= button_to "Content", "/" %>
2149+
# => <input type="submit" value="Content">
2150+
2151+
<%= button_to "/" do %>
2152+
Content
2153+
<% end %>
2154+
# => <button type="submit">Content</button>
2155+
```
2156+
2157+
Setting this value to `true` makes `button_to` generate a `<button>` tag inside
2158+
the `<form>` in both cases.
21322159
21332160
The default value depends on the `config.load_defaults` target version:
21342161
@@ -2139,7 +2166,8 @@ The default value depends on the `config.load_defaults` target version:
21392166
21402167
#### `config.action_view.apply_stylesheet_media_default`
21412168
2142-
Determines whether `stylesheet_link_tag` will render `screen` as the default value for the attribute `media` when it's not provided.
2169+
Determines whether `stylesheet_link_tag` will render `screen` as the default
2170+
value for the `media` attribute when it's not provided.
21432171

21442172
The default value depends on the `config.load_defaults` target version:
21452173

@@ -2243,8 +2271,10 @@ Additionally, it is possible to pass any [configuration option `Mail::SMTP` resp
22432271
22442272
#### `config.action_mailer.smtp_timeout`
22452273
2246-
Allows to configure both the `:open_timeout` and `:read_timeout`
2247-
values for `:smtp` delivery method.
2274+
Prior to version 2.8.0, the `mail` gem did not configure any default timeouts
2275+
for its SMTP requests. This configuration enables applications to configure
2276+
default values for both `:open_timeout` and `:read_timeout` in the `mail` gem so
2277+
that requests do not end up stuck indefinitely.
22482278
22492279
The default value depends on the `config.load_defaults` target version:
22502280

0 commit comments

Comments
 (0)