actionview 6.0.6.1 → 6.1.7.4

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