actionview 6.0.6.1 → 6.1.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +248 -220
  3. data/MIT-LICENSE +1 -2
  4. data/lib/action_view/base.rb +18 -49
  5. data/lib/action_view/cache_expiry.rb +1 -2
  6. data/lib/action_view/dependency_tracker.rb +10 -4
  7. data/lib/action_view/digestor.rb +3 -2
  8. data/lib/action_view/gem_version.rb +3 -3
  9. data/lib/action_view/helpers/asset_tag_helper.rb +57 -17
  10. data/lib/action_view/helpers/asset_url_helper.rb +6 -4
  11. data/lib/action_view/helpers/atom_feed_helper.rb +2 -1
  12. data/lib/action_view/helpers/cache_helper.rb +10 -16
  13. data/lib/action_view/helpers/date_helper.rb +6 -5
  14. data/lib/action_view/helpers/form_helper.rb +66 -30
  15. data/lib/action_view/helpers/form_options_helper.rb +7 -16
  16. data/lib/action_view/helpers/form_tag_helper.rb +4 -3
  17. data/lib/action_view/helpers/javascript_helper.rb +3 -3
  18. data/lib/action_view/helpers/number_helper.rb +6 -6
  19. data/lib/action_view/helpers/rendering_helper.rb +11 -3
  20. data/lib/action_view/helpers/tag_helper.rb +98 -22
  21. data/lib/action_view/helpers/tags/base.rb +10 -6
  22. data/lib/action_view/helpers/tags/check_box.rb +1 -1
  23. data/lib/action_view/helpers/tags/date_field.rb +1 -1
  24. data/lib/action_view/helpers/tags/date_select.rb +2 -2
  25. data/lib/action_view/helpers/tags/datetime_local_field.rb +1 -1
  26. data/lib/action_view/helpers/tags/hidden_field.rb +4 -0
  27. data/lib/action_view/helpers/tags/label.rb +4 -0
  28. data/lib/action_view/helpers/tags/month_field.rb +1 -1
  29. data/lib/action_view/helpers/tags/select.rb +1 -1
  30. data/lib/action_view/helpers/tags/time_field.rb +1 -1
  31. data/lib/action_view/helpers/tags/week_field.rb +1 -1
  32. data/lib/action_view/helpers/text_helper.rb +2 -2
  33. data/lib/action_view/helpers/translation_helper.rb +88 -50
  34. data/lib/action_view/helpers/url_helper.rb +136 -24
  35. data/lib/action_view/layouts.rb +3 -2
  36. data/lib/action_view/log_subscriber.rb +26 -10
  37. data/lib/action_view/lookup_context.rb +3 -18
  38. data/lib/action_view/path_set.rb +0 -3
  39. data/lib/action_view/railtie.rb +39 -46
  40. data/lib/action_view/renderer/abstract_renderer.rb +93 -14
  41. data/lib/action_view/renderer/collection_renderer.rb +196 -0
  42. data/lib/action_view/renderer/object_renderer.rb +34 -0
  43. data/lib/action_view/renderer/partial_renderer/collection_caching.rb +25 -26
  44. data/lib/action_view/renderer/partial_renderer.rb +20 -282
  45. data/lib/action_view/renderer/renderer.rb +44 -1
  46. data/lib/action_view/renderer/streaming_template_renderer.rb +5 -1
  47. data/lib/action_view/renderer/template_renderer.rb +15 -12
  48. data/lib/action_view/rendering.rb +3 -1
  49. data/lib/action_view/routing_url_for.rb +1 -1
  50. data/lib/action_view/template/handlers/erb/erubi.rb +9 -7
  51. data/lib/action_view/template/handlers/erb.rb +10 -14
  52. data/lib/action_view/template/handlers.rb +0 -26
  53. data/lib/action_view/template/html.rb +1 -11
  54. data/lib/action_view/template/raw_file.rb +0 -3
  55. data/lib/action_view/template/renderable.rb +24 -0
  56. data/lib/action_view/template/resolver.rb +82 -40
  57. data/lib/action_view/template/text.rb +0 -3
  58. data/lib/action_view/template.rb +9 -49
  59. data/lib/action_view/test_case.rb +18 -25
  60. data/lib/action_view/testing/resolvers.rb +10 -31
  61. data/lib/action_view/unbound_template.rb +3 -3
  62. data/lib/action_view/view_paths.rb +34 -36
  63. data/lib/action_view.rb +4 -1
  64. data/lib/assets/compiled/rails-ujs.js +38 -7
  65. metadata +15 -12
data/CHANGELOG.md CHANGED
@@ -1,24 +1,51 @@
1
- ## Rails 6.0.6.1 (January 17, 2023) ##
1
+ ## Rails 6.1.7.6 (August 22, 2023) ##
2
2
 
3
3
  * No changes.
4
4
 
5
5
 
6
- ## Rails 6.0.6 (September 09, 2022) ##
6
+ ## Rails 6.1.7.5 (August 22, 2023) ##
7
7
 
8
8
  * No changes.
9
9
 
10
10
 
11
- ## Rails 6.0.5.1 (July 12, 2022) ##
11
+ ## Rails 6.1.7.4 (June 26, 2023) ##
12
12
 
13
13
  * No changes.
14
14
 
15
15
 
16
- ## Rails 6.0.5 (May 09, 2022) ##
16
+ ## Rails 6.1.7.3 (March 13, 2023) ##
17
+
18
+ * Ignore certain data-* attributes in rails-ujs when element is contenteditable
19
+
20
+ [CVE-2023-23913]
21
+
22
+
23
+ ## Rails 6.1.7.2 (January 24, 2023) ##
24
+
25
+ * No changes.
26
+
27
+
28
+ ## Rails 6.1.7.1 (January 17, 2023) ##
29
+
30
+ * No changes.
31
+
32
+
33
+ ## Rails 6.1.7 (September 09, 2022) ##
34
+
35
+ * No changes.
36
+
37
+
38
+ ## Rails 6.1.6.1 (July 12, 2022) ##
39
+
40
+ * No changes.
41
+
42
+
43
+ ## Rails 6.1.6 (May 09, 2022) ##
17
44
 
18
45
  * No changes.
19
46
 
20
47
 
21
- ## Rails 6.0.4.8 (April 26, 2022) ##
48
+ ## Rails 6.1.5.1 (April 26, 2022) ##
22
49
 
23
50
  * Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
24
51
 
@@ -29,405 +56,406 @@
29
56
 
30
57
  *Álvaro Martín Fraguas*
31
58
 
59
+ ## Rails 6.1.5 (March 09, 2022) ##
32
60
 
33
- ## Rails 6.0.4.7 (March 08, 2022) ##
61
+ * `preload_link_tag` properly inserts `as` attributes for files with `image` MIME
62
+ types, such as JPG or SVG.
34
63
 
35
- * No changes.
64
+ *Nate Berkopec*
36
65
 
66
+ * Add `autocomplete="off"` to all generated hidden fields.
37
67
 
38
- ## Rails 6.0.4.6 (February 11, 2022) ##
68
+ Fixes #42610.
39
69
 
40
- * No changes.
70
+ *Ryan Baumann*
41
71
 
72
+ * Fix `current_page?` when URL has trailing slash.
42
73
 
43
- ## Rails 6.0.4.5 (February 11, 2022) ##
74
+ This fixes the `current_page?` helper when the given URL has a trailing slash,
75
+ and is an absolute URL or also has query params.
44
76
 
45
- * No changes.
77
+ Fixes #33956.
78
+
79
+ *Jonathan Hefner*
46
80
 
47
81
 
48
- ## Rails 6.0.4.4 (December 15, 2021) ##
82
+ ## Rails 6.1.4.7 (March 08, 2022) ##
49
83
 
50
84
  * No changes.
51
85
 
52
86
 
53
- ## Rails 6.0.4.3 (December 14, 2021) ##
87
+ ## Rails 6.1.4.6 (February 11, 2022) ##
54
88
 
55
89
  * No changes.
56
90
 
57
91
 
58
- ## Rails 6.0.4.2 (December 14, 2021) ##
92
+ ## Rails 6.1.4.5 (February 11, 2022) ##
59
93
 
60
94
  * No changes.
61
95
 
62
96
 
63
- ## Rails 6.0.4.1 (August 19, 2021) ##
97
+ ## Rails 6.1.4.4 (December 15, 2021) ##
64
98
 
65
99
  * No changes.
66
100
 
67
101
 
68
- ## Rails 6.0.4 (June 15, 2021) ##
69
-
70
- * SanitizeHelper.sanitized_allowed_attributes and SanitizeHelper.sanitized_allowed_tags
71
- call safe_list_sanitizer's class method
72
-
73
- Fixes #39586
102
+ ## Rails 6.1.4.3 (December 14, 2021) ##
74
103
 
75
- *Taufiq Muhammadi*
104
+ * No changes.
76
105
 
77
106
 
78
- ## Rails 6.0.3.7 (May 05, 2021) ##
107
+ ## Rails 6.1.4.2 (December 14, 2021) ##
79
108
 
80
109
  * No changes.
81
110
 
82
111
 
83
- ## Rails 6.0.3.6 (March 26, 2021) ##
112
+ ## Rails 6.1.4.1 (August 19, 2021) ##
84
113
 
85
114
  * No changes.
86
115
 
87
116
 
88
- ## Rails 6.0.3.5 (February 10, 2021) ##
117
+ ## Rails 6.1.4 (June 24, 2021) ##
89
118
 
90
- * No changes.
119
+ * The `translate` helper now passes `default` values that aren't
120
+ translation keys through `I18n.translate` for interpolation.
91
121
 
122
+ *Jonathan Hefner*
92
123
 
93
- ## Rails 6.0.3.4 (October 07, 2020) ##
124
+ * Don't attach UJS form submission handlers to Turbo forms.
94
125
 
95
- * No changes.
126
+ *David Heinemeier Hansson*
96
127
 
128
+ * Allow both `current_page?(url_hash)` and `current_page?(**url_hash)` on Ruby 2.7.
97
129
 
98
- ## Rails 6.0.3.3 (September 09, 2020) ##
130
+ *Ryuta Kamizono*
99
131
 
100
- * [CVE-2020-8185] Fix potential XSS vulnerability in the `translate`/`t` helper.
101
132
 
102
- *Jonathan Hefner*
133
+ ## Rails 6.1.3.2 (May 05, 2021) ##
134
+
135
+ * No changes.
103
136
 
104
137
 
105
- ## Rails 6.0.3.2 (June 17, 2020) ##
138
+ ## Rails 6.1.3.1 (March 26, 2021) ##
106
139
 
107
140
  * No changes.
108
141
 
109
142
 
110
- ## Rails 6.0.3.1 (May 18, 2020) ##
143
+ ## Rails 6.1.3 (February 17, 2021) ##
111
144
 
112
- * [CVE-2020-8167] Check that request is same-origin prior to including CSRF token in XHRs
145
+ * No changes.
113
146
 
114
147
 
115
- ## Rails 6.0.3 (May 06, 2020) ##
148
+ ## Rails 6.1.2.1 (February 10, 2021) ##
116
149
 
117
- * annotated_source_code returns an empty array so TemplateErrors without a
118
- template in the backtrace are surfaced properly by DebugExceptions.
150
+ * No changes.
119
151
 
120
- *Guilherme Mansur*, *Kasper Timm Hansen*
121
152
 
122
- * Add autoload for SyntaxErrorInTemplate so syntax errors are correctly raised by DebugExceptions.
153
+ ## Rails 6.1.2 (February 09, 2021) ##
123
154
 
124
- *Guilherme Mansur*, *Gannon McGibbon*
155
+ * No changes.
125
156
 
126
157
 
127
- ## Rails 6.0.2.2 (March 19, 2020) ##
158
+ ## Rails 6.1.1 (January 07, 2021) ##
128
159
 
129
- * Fix possible XSS vector in escape_javascript helper
160
+ * Fix lazy translation in partial with block.
130
161
 
131
- CVE-2020-5267
162
+ *Marek Kasztelnik*
132
163
 
133
- *Aaron Patterson*
164
+ * Avoid extra `SELECT COUNT` queries when rendering Active Record collections.
134
165
 
166
+ *aar0nr*
135
167
 
136
- ## Rails 6.0.2.1 (December 18, 2019) ##
168
+ * Link preloading keep integrity hashes in the header.
137
169
 
138
- * No changes.
170
+ *Étienne Barrié*
139
171
 
172
+ * Add `config.action_view.preload_links_header` to allow disabling of
173
+ the `Link` header being added by default when using `stylesheet_link_tag`
174
+ and `javascript_include_tag`.
140
175
 
141
- ## Rails 6.0.2 (December 13, 2019) ##
176
+ *Andrew White*
142
177
 
143
- * No changes.
178
+ * The `translate` helper now resolves `default` values when a `nil` key is
179
+ specified, instead of always returning `nil`.
144
180
 
181
+ *Jonathan Hefner*
145
182
 
146
- ## Rails 6.0.1 (November 5, 2019) ##
147
183
 
148
- * UJS avoids `Element.closest()` for IE 9 compatibility.
184
+ ## Rails 6.1.0 (December 09, 2020) ##
149
185
 
150
- *George Claghorn*
186
+ * SanitizeHelper.sanitized_allowed_attributes and SanitizeHelper.sanitized_allowed_tags
187
+ call safe_list_sanitizer's class method
151
188
 
189
+ Fixes #39586
152
190
 
153
- ## Rails 6.0.0 (August 16, 2019) ##
191
+ *Taufiq Muhammadi*
154
192
 
155
- * ActionView::Helpers::SanitizeHelper: support rails-html-sanitizer 1.1.0.
193
+ * Change form_with to generate non-remote forms by default.
156
194
 
157
- *Juanito Fatas*
195
+ `form_with` would generate a remote form by default. This would confuse
196
+ users because they were forced to handle remote requests.
158
197
 
198
+ All new 6.1 applications will generate non-remote forms by default.
199
+ When upgrading a 6.0 application you can enable remote forms by default by
200
+ setting `config.action_view.form_with_generates_remote_forms` to `true`.
159
201
 
160
- ## Rails 6.0.0.rc2 (July 22, 2019) ##
202
+ *Petrik de Heus*
161
203
 
162
- * Fix `select_tag` so that it doesn't change `options` when `include_blank` is present.
204
+ * Yield translated strings to calls of `ActionView::FormBuilder#button`
205
+ when a block is given.
163
206
 
164
- *Younes SERRAJ*
207
+ *Sean Doyle*
165
208
 
209
+ * Alias `ActionView::Helpers::Tags::Label::LabelBuilder#translation` to
210
+ `#to_s` so that `form.label` calls can yield that value to their blocks.
166
211
 
167
- ## Rails 6.0.0.rc1 (April 24, 2019) ##
212
+ *Sean Doyle*
168
213
 
169
- * Fix partial caching skips same item issue
214
+ * Rename the new `TagHelper#class_names` method to `TagHelper#token_list`,
215
+ and make the original available as an alias.
170
216
 
171
- If we render cached collection partials with repeated items, those repeated items
172
- will get skipped. For example, if you have 5 identical items in your collection, Rails
173
- only renders the first one when `cached` is set to true. But it should render all
174
- 5 items instead.
217
+ token_list("foo", "foo bar")
218
+ # => "foo bar"
175
219
 
176
- Fixes #35114.
220
+ *Sean Doyle*
177
221
 
178
- *Stan Lo*
222
+ * ARIA Array and Hash attributes are treated as space separated `DOMTokenList`
223
+ values. This is useful when declaring lists of label text identifiers in
224
+ `aria-labelledby` or `aria-describedby`.
179
225
 
180
- * Only clear ActionView cache in development on file changes
226
+ tag.input type: 'checkbox', name: 'published', aria: {
227
+ invalid: @post.errors[:published].any?,
228
+ labelledby: ['published_context', 'published_label'],
229
+ describedby: { published_errors: @post.errors[:published].any? }
230
+ }
231
+ #=> <input
232
+ type="checkbox" name="published" aria-invalid="true"
233
+ aria-labelledby="published_context published_label"
234
+ aria-describedby="published_errors"
235
+ >
181
236
 
182
- To speed up development mode, view caches are only cleared when files in
183
- the view paths have changed. Applications which have implemented custom
184
- `ActionView::Resolver` subclasses may need to add their own cache clearing.
237
+ *Sean Doyle*
185
238
 
186
- *John Hawthorn*
239
+ * Remove deprecated `escape_whitelist` from `ActionView::Template::Handlers::ERB`.
187
240
 
188
- * Fix `ActionView::FixtureResolver` so that it handles template variants correctly.
241
+ *Rafael Mendonça França*
189
242
 
190
- *Edward Rudd*
243
+ * Remove deprecated `find_all_anywhere` from `ActionView::Resolver`.
191
244
 
192
- * `ActionView::TemplateRender.render(file: )` now renders the file directly,
193
- without using any handlers, using the new `Template::RawFile` class.
245
+ *Rafael Mendonça França*
194
246
 
195
- *John Hawthorn*, *Cliff Pruitt*
247
+ * Remove deprecated `formats` from `ActionView::Template::HTML`.
196
248
 
249
+ *Rafael Mendonça França*
197
250
 
198
- ## Rails 6.0.0.beta3 (March 11, 2019) ##
251
+ * Remove deprecated `formats` from `ActionView::Template::RawFile`.
199
252
 
200
- * Only accept formats from registered mime types
253
+ *Rafael Mendonça França*
201
254
 
202
- A lack of filtering on mime types could allow an attacker to read
203
- arbitrary files on the target server or to perform a denial of service
204
- attack.
255
+ * Remove deprecated `formats` from `ActionView::Template::Text`.
205
256
 
206
- Fixes CVE-2019-5418
207
- Fixes CVE-2019-5419
257
+ *Rafael Mendonça França*
208
258
 
209
- *John Hawthorn*, *Eileen M. Uchitelle*, *Aaron Patterson*
259
+ * Remove deprecated `find_file` from `ActionView::PathSet`.
210
260
 
261
+ *Rafael Mendonça França*
211
262
 
212
- ## Rails 6.0.0.beta2 (February 25, 2019) ##
263
+ * Remove deprecated `rendered_format` from `ActionView::LookupContext`.
213
264
 
214
- * `ActionView::Template.finalize_compiled_template_methods` is deprecated with
215
- no replacement.
265
+ *Rafael Mendonça França*
216
266
 
217
- *tenderlove*
267
+ * Remove deprecated `find_file` from `ActionView::ViewPaths`.
218
268
 
219
- * `config.action_view.finalize_compiled_template_methods` is deprecated with
220
- no replacement.
269
+ *Rafael Mendonça França*
221
270
 
222
- *tenderlove*
271
+ * Require that `ActionView::Base` subclasses implement `#compiled_method_container`.
223
272
 
224
- * Ensure unique DOM IDs for collection inputs with float values.
273
+ *Rafael Mendonça França*
225
274
 
226
- Fixes #34974.
275
+ * Remove deprecated support to pass an object that is not a `ActionView::LookupContext` as the first argument
276
+ in `ActionView::Base#initialize`.
227
277
 
228
- *Mark Edmondson*
278
+ *Rafael Mendonça França*
229
279
 
230
- * Single arity template handlers are deprecated. Template handlers must
231
- now accept two parameters, the view object and the source for the view object.
280
+ * Remove deprecated `format` argument `ActionView::Base#initialize`.
232
281
 
233
- *tenderlove*
282
+ *Rafael Mendonça França*
234
283
 
284
+ * Remove deprecated `ActionView::Template#refresh`.
235
285
 
236
- ## Rails 6.0.0.beta1 (January 18, 2019) ##
286
+ *Rafael Mendonça França*
237
287
 
238
- * [Rename npm package](https://github.com/rails/rails/pull/34905) from
239
- [`rails-ujs`](https://www.npmjs.com/package/rails-ujs) to
240
- [`@rails/ujs`](https://www.npmjs.com/package/@rails/ujs).
288
+ * Remove deprecated `ActionView::Template#original_encoding`.
241
289
 
242
- *Javan Makhmali*
290
+ *Rafael Mendonça França*
243
291
 
244
- * Remove deprecated `image_alt` helper.
292
+ * Remove deprecated `ActionView::Template#variants`.
245
293
 
246
294
  *Rafael Mendonça França*
247
295
 
248
- * Fix the need of `#protect_against_forgery?` method defined in
249
- `ActionView::Base` subclasses. This prevents the use of forms and buttons.
296
+ * Remove deprecated `ActionView::Template#formats`.
250
297
 
251
- *Genadi Samokovarov*
252
-
253
- * Fix UJS permanently showing disabled text in a[data-remote][data-disable-with] elements within forms.
298
+ *Rafael Mendonça França*
254
299
 
255
- Fixes #33889.
300
+ * Remove deprecated `ActionView::Template#virtual_path=`.
256
301
 
257
- *Wolfgang Hobmaier*
302
+ *Rafael Mendonça França*
258
303
 
259
- * Prevent non-primary mouse keys from triggering Rails UJS click handlers.
260
- Firefox fires click events even if the click was triggered by non-primary mouse keys such as right- or scroll-wheel-clicks.
261
- For example, right-clicking a link such as the one described below (with an underlying ajax request registered on click) should not cause that request to occur.
304
+ * Remove deprecated `ActionView::Template#updated_at`.
262
305
 
263
- ```
264
- <%= link_to 'Remote', remote_path, class: 'remote', remote: true, data: { type: :json } %>
265
- ```
306
+ *Rafael Mendonça França*
266
307
 
267
- Fixes #34541.
308
+ * Remove deprecated `updated_at` argument required on `ActionView::Template#initialize`.
268
309
 
269
- *Wolfgang Hobmaier*
310
+ *Rafael Mendonça França*
270
311
 
271
- * Prevent `ActionView::TextHelper#word_wrap` from unexpectedly stripping white space from the _left_ side of lines.
312
+ * Make `locals` argument required on `ActionView::Template#initialize`.
272
313
 
273
- For example, given input like this:
314
+ *Rafael Mendonça França*
274
315
 
275
- ```
276
- This is a paragraph with an initial indent,
277
- followed by additional lines that are not indented,
278
- and finally terminated with a blockquote:
279
- "A pithy saying"
280
- ```
316
+ * Remove deprecated `ActionView::Template.finalize_compiled_template_methods`.
281
317
 
282
- Calling `word_wrap` should not trim the indents on the first and last lines.
318
+ *Rafael Mendonça França*
283
319
 
284
- Fixes #34487.
320
+ * Remove deprecated `config.action_view.finalize_compiled_template_methods`
285
321
 
286
- *Lyle Mullican*
322
+ *Rafael Mendonça França*
287
323
 
288
- * Add allocations to template rendering instrumentation.
324
+ * Remove deprecated support to calling `ActionView::ViewPaths#with_fallback` with a block.
289
325
 
290
- Adds the allocations for template and partial rendering to the server output on render.
326
+ *Rafael Mendonça França*
291
327
 
292
- ```
293
- Rendered posts/_form.html.erb (Duration: 7.1ms | Allocations: 6004)
294
- Rendered posts/new.html.erb within layouts/application (Duration: 8.3ms | Allocations: 6654)
295
- Completed 200 OK in 858ms (Views: 848.4ms | ActiveRecord: 0.4ms | Allocations: 1539564)
296
- ```
328
+ * Remove deprecated support to passing absolute paths to `render template:`.
297
329
 
298
- *Eileen M. Uchitelle*, *Aaron Patterson*
330
+ *Rafael Mendonça França*
299
331
 
300
- * Respect the `only_path` option passed to `url_for` when the options are passed in as an array
332
+ * Remove deprecated support to passing relative paths to `render file:`.
301
333
 
302
- Fixes #33237.
334
+ *Rafael Mendonça França*
303
335
 
304
- *Joel Ambass*
336
+ * Remove support to template handlers that don't accept two arguments.
305
337
 
306
- * Deprecate calling private model methods from view helpers.
338
+ *Rafael Mendonça França*
307
339
 
308
- For example, in methods like `options_from_collection_for_select`
309
- and `collection_select` it is possible to call private methods from
310
- the objects used.
340
+ * Remove deprecated pattern argument in `ActionView::Template::PathResolver`.
311
341
 
312
- Fixes #33546.
342
+ *Rafael Mendonça França*
313
343
 
314
- *Ana María Martínez Gómez*
344
+ * Remove deprecated support to call private methods from object in some view helpers.
315
345
 
316
- * Fix issue with `button_to`'s `to_form_params`
346
+ *Rafael Mendonça França*
317
347
 
318
- `button_to` was throwing exception when invoked with `params` hash that
319
- contains symbol and string keys. The reason for the exception was that
320
- `to_form_params` was comparing the given symbol and string keys.
348
+ * `ActionView::Helpers::TranslationHelper#translate` accepts a block, yielding
349
+ the translated text and the fully resolved translation key:
321
350
 
322
- The issue is fixed by turning all keys to strings inside
323
- `to_form_params` before comparing them.
351
+ <%= translate(".relative_key") do |translation, resolved_key| %>
352
+ <span title="<%= resolved_key %>"><%= translation %></span>
353
+ <% end %>
324
354
 
325
- *Georgi Georgiev*
355
+ *Sean Doyle*
326
356
 
327
- * Mark arrays of translations as trusted safe by using the `_html` suffix.
357
+ * Ensure cache fragment digests include all relevant template dependencies when
358
+ fragments are contained in a block passed to the render helper. Remove the
359
+ virtual_path keyword arguments found in CacheHelper as they no longer possess
360
+ any function following 1581cab.
328
361
 
329
- Example:
362
+ Fixes #38984.
330
363
 
331
- en:
332
- foo_html:
333
- - "One"
334
- - "<strong>Two</strong>"
335
- - "Three &#128075; &#128578;"
364
+ *Aaron Lipman*
336
365
 
337
- *Juan Broullon*
366
+ * Deprecate `config.action_view.raise_on_missing_translations` in favor of
367
+ `config.i18n.raise_on_missing_translations`.
338
368
 
339
- * Add `year_format` option to date_select tag. This option makes it possible to customize year
340
- names. Lambda should be passed to use this option.
369
+ New generalized configuration option now determines whether an error should be raised
370
+ for missing translations in controllers and views.
341
371
 
342
- Example:
372
+ *fatkodima*
343
373
 
344
- date_select('user_birthday', '', start_year: 1998, end_year: 2000, year_format: ->year { "Heisei #{year - 1988}" })
374
+ * Instrument layout rendering in `TemplateRenderer#render_with_layout` as `render_layout.action_view`,
375
+ and include (when necessary) the layout's virtual path in notification payloads for collection and partial renders.
345
376
 
346
- The HTML produced:
377
+ *Zach Kemp*
347
378
 
348
- <select id="user_birthday__1i" name="user_birthday[(1i)]">
349
- <option value="1998">Heisei 10</option>
350
- <option value="1999">Heisei 11</option>
351
- <option value="2000">Heisei 12</option>
352
- </select>
353
- /* The rest is omitted */
379
+ * `ActionView::Base.annotate_rendered_view_with_filenames` annotates HTML output with template file names.
354
380
 
355
- *Koki Ryu*
381
+ *Joel Hawksley*, *Aaron Patterson*
356
382
 
357
- * Fix JavaScript views rendering does not work with Firefox when using
358
- Content Security Policy.
383
+ * `ActionView::Helpers::TranslationHelper#translate` returns nil when
384
+ passed `default: nil` without a translation matching `I18n#translate`.
359
385
 
360
- Fixes #32577.
386
+ *Stefan Wrobel*
361
387
 
362
- *Yuji Yaginuma*
388
+ * `OptimizedFileSystemResolver` prefers template details in order of locale,
389
+ formats, variants, handlers.
363
390
 
364
- * Add the `nonce: true` option for `javascript_include_tag` helper to
365
- support automatic nonce generation for Content Security Policy.
366
- Works the same way as `javascript_tag nonce: true` does.
391
+ *Iago Pimenta*
367
392
 
368
- *Yaroslav Markin*
393
+ * Added `class_names` helper to create a CSS class value with conditional classes.
369
394
 
370
- * Remove `ActionView::Helpers::RecordTagHelper`.
395
+ *Joel Hawksley*, *Aaron Patterson*
371
396
 
372
- *Yoshiyuki Hirano*
397
+ * Add support for conditional values to TagBuilder.
373
398
 
374
- * Disable `ActionView::Template` finalizers in test environment.
399
+ *Joel Hawksley*
375
400
 
376
- Template finalization can be expensive in large view test suites.
377
- Add a configuration option,
378
- `action_view.finalize_compiled_template_methods`, and turn it off in
379
- the test environment.
401
+ * `ActionView::Helpers::FormOptionsHelper#select` should mark option for `nil` as selected.
380
402
 
381
- *Simon Coffey*
403
+ ```ruby
404
+ @post = Post.new
405
+ @post.category = nil
382
406
 
383
- * Extract the `confirm` call in its own, overridable method in `rails_ujs`.
407
+ # Before
408
+ select("post", "category", none: nil, programming: 1, economics: 2)
409
+ # =>
410
+ # <select name="post[category]" id="post_category">
411
+ # <option value="">none</option>
412
+ # <option value="1">programming</option>
413
+ # <option value="2">economics</option>
414
+ # </select>
384
415
 
385
- Example:
416
+ # After
417
+ select("post", "category", none: nil, programming: 1, economics: 2)
418
+ # =>
419
+ # <select name="post[category]" id="post_category">
420
+ # <option selected="selected" value="">none</option>
421
+ # <option value="1">programming</option>
422
+ # <option value="2">economics</option>
423
+ # </select>
424
+ ```
386
425
 
387
- Rails.confirm = function(message, element) {
388
- return (my_bootstrap_modal_confirm(message));
389
- }
426
+ *bogdanvlviv*
390
427
 
391
- *Mathieu Mahé*
428
+ * Log lines for partial renders and started template renders are now
429
+ emitted at the `DEBUG` level instead of `INFO`.
392
430
 
393
- * Enable select tag helper to mark `prompt` option as `selected` and/or `disabled` for `required`
394
- field.
431
+ Completed template renders are still logged at the `INFO` level.
395
432
 
396
- Example:
433
+ *DHH*
397
434
 
398
- select :post,
399
- :category,
400
- ["lifestyle", "programming", "spiritual"],
401
- { selected: "", disabled: "", prompt: "Choose one" },
402
- { required: true }
435
+ * ActionView::Helpers::SanitizeHelper: support rails-html-sanitizer 1.1.0.
403
436
 
404
- Placeholder option would be selected and disabled.
437
+ *Juanito Fatas*
405
438
 
406
- The HTML produced:
439
+ * Added `phone_to` helper method to create a link from mobile numbers.
407
440
 
408
- <select required="required" name="post[category]" id="post_category">
409
- <option disabled="disabled" selected="selected" value="">Choose one</option>
410
- <option value="lifestyle">lifestyle</option>
411
- <option value="programming">programming</option>
412
- <option value="spiritual">spiritual</option></select>
441
+ *Pietro Moro*
413
442
 
414
- *Sergey Prikhodko*
443
+ * annotated_source_code returns an empty array so TemplateErrors without a
444
+ template in the backtrace are surfaced properly by DebugExceptions.
415
445
 
416
- * Don't enforce UTF-8 by default.
446
+ *Guilherme Mansur*, *Kasper Timm Hansen*
417
447
 
418
- With the disabling of TLS 1.0 by most major websites, continuing to run
419
- IE8 or lower becomes increasingly difficult so default to not enforcing
420
- UTF-8 encoding as it's not relevant to other browsers.
448
+ * Add autoload for SyntaxErrorInTemplate so syntax errors are correctly raised by DebugExceptions.
421
449
 
422
- *Andrew White*
450
+ *Guilherme Mansur*, *Gannon McGibbon*
423
451
 
424
- * Change translation key of `submit_tag` from `module_name_class_name` to `module_name/class_name`.
452
+ * `RenderingHelper` supports rendering objects that `respond_to?` `:render_in`.
425
453
 
426
- *Rui Onodera*
454
+ *Joel Hawksley*, *Natasha Umer*, *Aaron Patterson*, *Shawn Allen*, *Emily Plummer*, *Diana Mounter*, *John Hawthorn*, *Nathan Herald*, *Zaid Zawaideh*, *Zach Ahn*
427
455
 
428
- * Rails 6 requires Ruby 2.5.0 or newer.
456
+ * Fix `select_tag` so that it doesn't change `options` when `include_blank` is present.
429
457
 
430
- *Jeremy Daer*, *Kasper Timm Hansen*
458
+ *Younes SERRAJ*
431
459
 
432
460
 
433
- Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/actionview/CHANGELOG.md) for previous changes.
461
+ Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actionview/CHANGELOG.md) for previous changes.