actionview 6.0.6.1 → 6.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionview might be problematic. Click here for more details.

Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +152 -325
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +1 -1
  5. data/lib/action_view/base.rb +20 -51
  6. data/lib/action_view/cache_expiry.rb +1 -2
  7. data/lib/action_view/context.rb +0 -1
  8. data/lib/action_view/dependency_tracker.rb +10 -4
  9. data/lib/action_view/digestor.rb +3 -2
  10. data/lib/action_view/gem_version.rb +3 -3
  11. data/lib/action_view/helpers/asset_tag_helper.rb +40 -15
  12. data/lib/action_view/helpers/asset_url_helper.rb +6 -4
  13. data/lib/action_view/helpers/atom_feed_helper.rb +2 -1
  14. data/lib/action_view/helpers/cache_helper.rb +10 -16
  15. data/lib/action_view/helpers/date_helper.rb +4 -4
  16. data/lib/action_view/helpers/form_helper.rb +59 -17
  17. data/lib/action_view/helpers/form_options_helper.rb +7 -16
  18. data/lib/action_view/helpers/form_tag_helper.rb +8 -6
  19. data/lib/action_view/helpers/javascript_helper.rb +3 -3
  20. data/lib/action_view/helpers/number_helper.rb +6 -6
  21. data/lib/action_view/helpers/rendering_helper.rb +11 -3
  22. data/lib/action_view/helpers/sanitize_helper.rb +2 -2
  23. data/lib/action_view/helpers/tag_helper.rb +96 -52
  24. data/lib/action_view/helpers/tags/base.rb +9 -5
  25. data/lib/action_view/helpers/tags/date_field.rb +1 -1
  26. data/lib/action_view/helpers/tags/date_select.rb +2 -2
  27. data/lib/action_view/helpers/tags/datetime_local_field.rb +1 -1
  28. data/lib/action_view/helpers/tags/label.rb +4 -0
  29. data/lib/action_view/helpers/tags/month_field.rb +1 -1
  30. data/lib/action_view/helpers/tags/select.rb +1 -1
  31. data/lib/action_view/helpers/tags/time_field.rb +1 -1
  32. data/lib/action_view/helpers/tags/week_field.rb +1 -1
  33. data/lib/action_view/helpers/text_helper.rb +1 -1
  34. data/lib/action_view/helpers/translation_helper.rb +88 -53
  35. data/lib/action_view/helpers/url_helper.rb +107 -13
  36. data/lib/action_view/layouts.rb +3 -2
  37. data/lib/action_view/log_subscriber.rb +26 -10
  38. data/lib/action_view/lookup_context.rb +3 -18
  39. data/lib/action_view/path_set.rb +0 -3
  40. data/lib/action_view/railtie.rb +35 -46
  41. data/lib/action_view/renderer/abstract_renderer.rb +93 -14
  42. data/lib/action_view/renderer/collection_renderer.rb +192 -0
  43. data/lib/action_view/renderer/object_renderer.rb +34 -0
  44. data/lib/action_view/renderer/partial_renderer/collection_caching.rb +25 -26
  45. data/lib/action_view/renderer/partial_renderer.rb +20 -282
  46. data/lib/action_view/renderer/renderer.rb +44 -1
  47. data/lib/action_view/renderer/streaming_template_renderer.rb +5 -1
  48. data/lib/action_view/renderer/template_renderer.rb +15 -12
  49. data/lib/action_view/rendering.rb +3 -1
  50. data/lib/action_view/routing_url_for.rb +1 -1
  51. data/lib/action_view/template/handlers/erb/erubi.rb +9 -7
  52. data/lib/action_view/template/handlers/erb.rb +10 -14
  53. data/lib/action_view/template/handlers.rb +0 -26
  54. data/lib/action_view/template/html.rb +1 -11
  55. data/lib/action_view/template/raw_file.rb +0 -3
  56. data/lib/action_view/template/renderable.rb +24 -0
  57. data/lib/action_view/template/resolver.rb +82 -40
  58. data/lib/action_view/template/text.rb +0 -3
  59. data/lib/action_view/template.rb +9 -49
  60. data/lib/action_view/test_case.rb +18 -25
  61. data/lib/action_view/testing/resolvers.rb +10 -31
  62. data/lib/action_view/unbound_template.rb +3 -3
  63. data/lib/action_view/view_paths.rb +34 -36
  64. data/lib/action_view.rb +4 -1
  65. data/lib/assets/compiled/rails-ujs.js +1 -1
  66. metadata +20 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85ed7f3786ca26616ab0484acdfe55d872c9d8bd1951ecc417d4112909e3d596
4
- data.tar.gz: 1219bad150f3ced43cd4527b60b392607d1506c502ec866b15c66887f183b703
3
+ metadata.gz: c6501d14d3ded1b369986260419c6aee627f1b7799b3c3c4218873bfe8d4b479
4
+ data.tar.gz: 989267ee82dfffffb28da4b86b9eb462dd4e0bd3d379763b6b1e263ff29739b1
5
5
  SHA512:
6
- metadata.gz: 785a601e59d00518c26fa3b5714e930c9747131443a980b9f05d8230453f9b5e62e3b54995eeb18ebbaa0b0a1480e3fff80669c3d29e26270f685fa6a93356dd
7
- data.tar.gz: 34e1410363d3b99607f88993f350e441c502938c179ec114af0d3d63f9a72b25b18c8edc258586006e75fdffbdf112bbed5b1fc6beccba995610909a5b4b2873
6
+ metadata.gz: 0604fd5bb813f716bff94d3ac476ad3a466b8ea6e02e022b4ee29cf5f3a0389ec70f50fc532e37a857307b2180e69d0db2c0c42abcf603677789df8b44acad0f
7
+ data.tar.gz: 54f5d17012d6817bd687d80dff5bd36ffff2ea6fc8461ac2e81fde65a73dea829a076351ff812516f80869ae0dbda5eda4d8181b731bfd31ae92b56cca03ab53
data/CHANGELOG.md CHANGED
@@ -1,433 +1,260 @@
1
- ## Rails 6.0.6.1 (January 17, 2023) ##
1
+ ## Rails 6.1.0.rc1 (November 02, 2020) ##
2
2
 
3
- * No changes.
3
+ * Yield translated strings to calls of `ActionView::FormBuilder#button`
4
+ when a block is given.
4
5
 
6
+ *Sean Doyle*
5
7
 
6
- ## Rails 6.0.6 (September 09, 2022) ##
8
+ * Alias `ActionView::Helpers::Tags::Label::LabelBuilder#translation` to
9
+ `#to_s` so that `form.label` calls can yield that value to their blocks.
7
10
 
8
- * No changes.
11
+ *Sean Doyle*
9
12
 
13
+ * Rename the new `TagHelper#class_names` method to `TagHelper#token_list`,
14
+ and make the original available as an alias.
10
15
 
11
- ## Rails 6.0.5.1 (July 12, 2022) ##
16
+ token_list("foo", "foo bar")
17
+ # => "foo bar"
12
18
 
13
- * No changes.
19
+ *Sean Doyle*
14
20
 
21
+ * ARIA Array and Hash attributes are treated as space separated `DOMTokenList`
22
+ values. This is useful when declaring lists of label text identifiers in
23
+ `aria-labelledby` or `aria-describedby`.
15
24
 
16
- ## Rails 6.0.5 (May 09, 2022) ##
17
-
18
- * No changes.
19
-
20
-
21
- ## Rails 6.0.4.8 (April 26, 2022) ##
22
-
23
- * Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
24
-
25
- Escape dangerous characters in names of tags and names of attributes in the
26
- tag helpers, following the XML specification. Rename the option
27
- `:escape_attributes` to `:escape`, to simplify by applying the option to the
28
- whole tag.
29
-
30
- *Álvaro Martín Fraguas*
31
-
32
-
33
- ## Rails 6.0.4.7 (March 08, 2022) ##
34
-
35
- * No changes.
36
-
37
-
38
- ## Rails 6.0.4.6 (February 11, 2022) ##
39
-
40
- * No changes.
41
-
42
-
43
- ## Rails 6.0.4.5 (February 11, 2022) ##
44
-
45
- * No changes.
46
-
47
-
48
- ## Rails 6.0.4.4 (December 15, 2021) ##
49
-
50
- * No changes.
51
-
52
-
53
- ## Rails 6.0.4.3 (December 14, 2021) ##
54
-
55
- * No changes.
56
-
57
-
58
- ## Rails 6.0.4.2 (December 14, 2021) ##
59
-
60
- * No changes.
61
-
62
-
63
- ## Rails 6.0.4.1 (August 19, 2021) ##
64
-
65
- * No changes.
66
-
67
-
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
74
-
75
- *Taufiq Muhammadi*
76
-
77
-
78
- ## Rails 6.0.3.7 (May 05, 2021) ##
79
-
80
- * No changes.
81
-
82
-
83
- ## Rails 6.0.3.6 (March 26, 2021) ##
84
-
85
- * No changes.
86
-
87
-
88
- ## Rails 6.0.3.5 (February 10, 2021) ##
89
-
90
- * No changes.
91
-
92
-
93
- ## Rails 6.0.3.4 (October 07, 2020) ##
94
-
95
- * No changes.
96
-
97
-
98
- ## Rails 6.0.3.3 (September 09, 2020) ##
99
-
100
- * [CVE-2020-8185] Fix potential XSS vulnerability in the `translate`/`t` helper.
101
-
102
- *Jonathan Hefner*
103
-
104
-
105
- ## Rails 6.0.3.2 (June 17, 2020) ##
106
-
107
- * No changes.
108
-
109
-
110
- ## Rails 6.0.3.1 (May 18, 2020) ##
111
-
112
- * [CVE-2020-8167] Check that request is same-origin prior to including CSRF token in XHRs
113
-
114
-
115
- ## Rails 6.0.3 (May 06, 2020) ##
116
-
117
- * annotated_source_code returns an empty array so TemplateErrors without a
118
- template in the backtrace are surfaced properly by DebugExceptions.
119
-
120
- *Guilherme Mansur*, *Kasper Timm Hansen*
121
-
122
- * Add autoload for SyntaxErrorInTemplate so syntax errors are correctly raised by DebugExceptions.
123
-
124
- *Guilherme Mansur*, *Gannon McGibbon*
125
-
126
-
127
- ## Rails 6.0.2.2 (March 19, 2020) ##
128
-
129
- * Fix possible XSS vector in escape_javascript helper
130
-
131
- CVE-2020-5267
132
-
133
- *Aaron Patterson*
134
-
135
-
136
- ## Rails 6.0.2.1 (December 18, 2019) ##
137
-
138
- * No changes.
139
-
140
-
141
- ## Rails 6.0.2 (December 13, 2019) ##
142
-
143
- * No changes.
144
-
145
-
146
- ## Rails 6.0.1 (November 5, 2019) ##
147
-
148
- * UJS avoids `Element.closest()` for IE 9 compatibility.
149
-
150
- *George Claghorn*
151
-
152
-
153
- ## Rails 6.0.0 (August 16, 2019) ##
154
-
155
- * ActionView::Helpers::SanitizeHelper: support rails-html-sanitizer 1.1.0.
156
-
157
- *Juanito Fatas*
158
-
159
-
160
- ## Rails 6.0.0.rc2 (July 22, 2019) ##
161
-
162
- * Fix `select_tag` so that it doesn't change `options` when `include_blank` is present.
163
-
164
- *Younes SERRAJ*
165
-
166
-
167
- ## Rails 6.0.0.rc1 (April 24, 2019) ##
168
-
169
- * Fix partial caching skips same item issue
170
-
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.
175
-
176
- Fixes #35114.
177
-
178
- *Stan Lo*
179
-
180
- * Only clear ActionView cache in development on file changes
25
+ tag.input type: 'checkbox', name: 'published', aria: {
26
+ invalid: @post.errors[:published].any?,
27
+ labelledby: ['published_context', 'published_label'],
28
+ describedby: { published_errors: @post.errors[:published].any? }
29
+ }
30
+ #=> <input
31
+ type="checkbox" name="published" aria-invalid="true"
32
+ aria-labelledby="published_context published_label"
33
+ aria-describedby="published_errors"
34
+ >
181
35
 
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.
36
+ *Sean Doyle*
185
37
 
186
- *John Hawthorn*
38
+ * Remove deprecated `escape_whitelist` from `ActionView::Template::Handlers::ERB`.
187
39
 
188
- * Fix `ActionView::FixtureResolver` so that it handles template variants correctly.
40
+ *Rafael Mendonça França*
189
41
 
190
- *Edward Rudd*
42
+ * Remove deprecated `find_all_anywhere` from `ActionView::Resolver`.
191
43
 
192
- * `ActionView::TemplateRender.render(file: )` now renders the file directly,
193
- without using any handlers, using the new `Template::RawFile` class.
44
+ *Rafael Mendonça França*
194
45
 
195
- *John Hawthorn*, *Cliff Pruitt*
46
+ * Remove deprecated `formats` from `ActionView::Template::HTML`.
196
47
 
48
+ *Rafael Mendonça França*
197
49
 
198
- ## Rails 6.0.0.beta3 (March 11, 2019) ##
50
+ * Remove deprecated `formats` from `ActionView::Template::RawFile`.
199
51
 
200
- * Only accept formats from registered mime types
52
+ *Rafael Mendonça França*
201
53
 
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.
54
+ * Remove deprecated `formats` from `ActionView::Template::Text`.
205
55
 
206
- Fixes CVE-2019-5418
207
- Fixes CVE-2019-5419
56
+ *Rafael Mendonça França*
208
57
 
209
- *John Hawthorn*, *Eileen M. Uchitelle*, *Aaron Patterson*
58
+ * Remove deprecated `find_file` from `ActionView::PathSet`.
210
59
 
60
+ *Rafael Mendonça França*
211
61
 
212
- ## Rails 6.0.0.beta2 (February 25, 2019) ##
62
+ * Remove deprecated `rendered_format` from `ActionView::LookupContext`.
213
63
 
214
- * `ActionView::Template.finalize_compiled_template_methods` is deprecated with
215
- no replacement.
64
+ *Rafael Mendonça França*
216
65
 
217
- *tenderlove*
66
+ * Remove deprecated `find_file` from `ActionView::ViewPaths`.
218
67
 
219
- * `config.action_view.finalize_compiled_template_methods` is deprecated with
220
- no replacement.
68
+ *Rafael Mendonça França*
221
69
 
222
- *tenderlove*
70
+ * Require that `ActionView::Base` subclasses implement `#compiled_method_container`.
223
71
 
224
- * Ensure unique DOM IDs for collection inputs with float values.
72
+ *Rafael Mendonça França*
225
73
 
226
- Fixes #34974.
74
+ * Remove deprecated support to pass an object that is not a `ActionView::LookupContext` as the first argument
75
+ in `ActionView::Base#initialize`.
227
76
 
228
- *Mark Edmondson*
77
+ *Rafael Mendonça França*
229
78
 
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.
79
+ * Remove deprecated `format` argument `ActionView::Base#initialize`.
232
80
 
233
- *tenderlove*
81
+ *Rafael Mendonça França*
234
82
 
83
+ * Remove deprecated `ActionView::Template#refresh`.
235
84
 
236
- ## Rails 6.0.0.beta1 (January 18, 2019) ##
85
+ *Rafael Mendonça França*
237
86
 
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).
87
+ * Remove deprecated `ActionView::Template#original_encoding`.
241
88
 
242
- *Javan Makhmali*
89
+ *Rafael Mendonça França*
243
90
 
244
- * Remove deprecated `image_alt` helper.
91
+ * Remove deprecated `ActionView::Template#variants`.
245
92
 
246
93
  *Rafael Mendonça França*
247
94
 
248
- * Fix the need of `#protect_against_forgery?` method defined in
249
- `ActionView::Base` subclasses. This prevents the use of forms and buttons.
95
+ * Remove deprecated `ActionView::Template#formats`.
250
96
 
251
- *Genadi Samokovarov*
252
-
253
- * Fix UJS permanently showing disabled text in a[data-remote][data-disable-with] elements within forms.
97
+ *Rafael Mendonça França*
254
98
 
255
- Fixes #33889.
99
+ * Remove deprecated `ActionView::Template#virtual_path=`.
256
100
 
257
- *Wolfgang Hobmaier*
101
+ *Rafael Mendonça França*
258
102
 
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.
103
+ * Remove deprecated `ActionView::Template#updated_at`.
262
104
 
263
- ```
264
- <%= link_to 'Remote', remote_path, class: 'remote', remote: true, data: { type: :json } %>
265
- ```
105
+ *Rafael Mendonça França*
266
106
 
267
- Fixes #34541.
107
+ * Remove deprecated `updated_at` argument required on `ActionView::Template#initialize`.
268
108
 
269
- *Wolfgang Hobmaier*
109
+ *Rafael Mendonça França*
270
110
 
271
- * Prevent `ActionView::TextHelper#word_wrap` from unexpectedly stripping white space from the _left_ side of lines.
111
+ * Make `locals` argument required on `ActionView::Template#initialize`.
272
112
 
273
- For example, given input like this:
113
+ *Rafael Mendonça França*
274
114
 
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
- ```
115
+ * Remove deprecated `ActionView::Template.finalize_compiled_template_methods`.
281
116
 
282
- Calling `word_wrap` should not trim the indents on the first and last lines.
117
+ *Rafael Mendonça França*
283
118
 
284
- Fixes #34487.
119
+ * Remove deprecated `config.action_view.finalize_compiled_template_methods`
285
120
 
286
- *Lyle Mullican*
121
+ *Rafael Mendonça França*
287
122
 
288
- * Add allocations to template rendering instrumentation.
123
+ * Remove deprecated support to calling `ActionView::ViewPaths#with_fallback` with a block.
289
124
 
290
- Adds the allocations for template and partial rendering to the server output on render.
125
+ *Rafael Mendonça França*
291
126
 
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
- ```
127
+ * Remove deprecated support to passing absolute paths to `render template:`.
297
128
 
298
- *Eileen M. Uchitelle*, *Aaron Patterson*
129
+ *Rafael Mendonça França*
299
130
 
300
- * Respect the `only_path` option passed to `url_for` when the options are passed in as an array
131
+ * Remove deprecated support to passing relative paths to `render file:`.
301
132
 
302
- Fixes #33237.
133
+ *Rafael Mendonça França*
303
134
 
304
- *Joel Ambass*
135
+ * Remove support to template handlers that don't accept two arguments.
305
136
 
306
- * Deprecate calling private model methods from view helpers.
137
+ *Rafael Mendonça França*
307
138
 
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.
139
+ * Remove deprecated pattern argument in `ActionView::Template::PathResolver`.
311
140
 
312
- Fixes #33546.
141
+ *Rafael Mendonça França*
313
142
 
314
- *Ana María Martínez Gómez*
143
+ * Remove deprecated support to call private methods from object in some view helpers.
315
144
 
316
- * Fix issue with `button_to`'s `to_form_params`
145
+ *Rafael Mendonça França*
317
146
 
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.
147
+ * `ActionView::Helpers::TranslationHelper#translate` accepts a block, yielding
148
+ the translated text and the fully resolved translation key:
321
149
 
322
- The issue is fixed by turning all keys to strings inside
323
- `to_form_params` before comparing them.
150
+ <%= translate(".relative_key") do |translation, resolved_key| %>
151
+ <span title="<%= resolved_key %>"><%= translation %></span>
152
+ <% end %>
324
153
 
325
- *Georgi Georgiev*
154
+ *Sean Doyle*
326
155
 
327
- * Mark arrays of translations as trusted safe by using the `_html` suffix.
156
+ * Ensure cache fragment digests include all relevant template dependencies when
157
+ fragments are contained in a block passed to the render helper. Remove the
158
+ virtual_path keyword arguments found in CacheHelper as they no longer possess
159
+ any function following 1581cab.
328
160
 
329
- Example:
161
+ Fixes #38984.
330
162
 
331
- en:
332
- foo_html:
333
- - "One"
334
- - "<strong>Two</strong>"
335
- - "Three &#128075; &#128578;"
163
+ *Aaron Lipman*
336
164
 
337
- *Juan Broullon*
165
+ * Deprecate `config.action_view.raise_on_missing_translations` in favor of
166
+ `config.i18n.raise_on_missing_translations`.
338
167
 
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.
168
+ New generalized configuration option now determines whether an error should be raised
169
+ for missing translations in controllers and views.
341
170
 
342
- Example:
171
+ *fatkodima*
343
172
 
344
- date_select('user_birthday', '', start_year: 1998, end_year: 2000, year_format: ->year { "Heisei #{year - 1988}" })
173
+ * Instrument layout rendering in `TemplateRenderer#render_with_layout` as `render_layout.action_view`,
174
+ and include (when necessary) the layout's virtual path in notification payloads for collection and partial renders.
345
175
 
346
- The HTML produced:
176
+ *Zach Kemp*
347
177
 
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 */
178
+ * `ActionView::Base.annotate_rendered_view_with_filenames` annotates HTML output with template file names.
354
179
 
355
- *Koki Ryu*
180
+ *Joel Hawksley*, *Aaron Patterson*
356
181
 
357
- * Fix JavaScript views rendering does not work with Firefox when using
358
- Content Security Policy.
182
+ * `ActionView::Helpers::TranslationHelper#translate` returns nil when
183
+ passed `default: nil` without a translation matching `I18n#translate`.
359
184
 
360
- Fixes #32577.
185
+ *Stefan Wrobel*
361
186
 
362
- *Yuji Yaginuma*
187
+ * `OptimizedFileSystemResolver` prefers template details in order of locale,
188
+ formats, variants, handlers.
363
189
 
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.
190
+ *Iago Pimenta*
367
191
 
368
- *Yaroslav Markin*
192
+ * Added `class_names` helper to create a CSS class value with conditional classes.
369
193
 
370
- * Remove `ActionView::Helpers::RecordTagHelper`.
194
+ *Joel Hawksley*, *Aaron Patterson*
371
195
 
372
- *Yoshiyuki Hirano*
196
+ * Add support for conditional values to TagBuilder.
373
197
 
374
- * Disable `ActionView::Template` finalizers in test environment.
198
+ *Joel Hawksley*
375
199
 
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.
200
+ * `ActionView::Helpers::FormOptionsHelper#select` should mark option for `nil` as selected.
380
201
 
381
- *Simon Coffey*
202
+ ```ruby
203
+ @post = Post.new
204
+ @post.category = nil
382
205
 
383
- * Extract the `confirm` call in its own, overridable method in `rails_ujs`.
206
+ # Before
207
+ select("post", "category", none: nil, programming: 1, economics: 2)
208
+ # =>
209
+ # <select name="post[category]" id="post_category">
210
+ # <option value="">none</option>
211
+ # <option value="1">programming</option>
212
+ # <option value="2">economics</option>
213
+ # </select>
384
214
 
385
- Example:
215
+ # After
216
+ select("post", "category", none: nil, programming: 1, economics: 2)
217
+ # =>
218
+ # <select name="post[category]" id="post_category">
219
+ # <option selected="selected" value="">none</option>
220
+ # <option value="1">programming</option>
221
+ # <option value="2">economics</option>
222
+ # </select>
223
+ ```
386
224
 
387
- Rails.confirm = function(message, element) {
388
- return (my_bootstrap_modal_confirm(message));
389
- }
225
+ *bogdanvlviv*
390
226
 
391
- *Mathieu Mahé*
227
+ * Log lines for partial renders and started template renders are now
228
+ emitted at the `DEBUG` level instead of `INFO`.
392
229
 
393
- * Enable select tag helper to mark `prompt` option as `selected` and/or `disabled` for `required`
394
- field.
230
+ Completed template renders are still logged at the `INFO` level.
395
231
 
396
- Example:
232
+ *DHH*
397
233
 
398
- select :post,
399
- :category,
400
- ["lifestyle", "programming", "spiritual"],
401
- { selected: "", disabled: "", prompt: "Choose one" },
402
- { required: true }
234
+ * ActionView::Helpers::SanitizeHelper: support rails-html-sanitizer 1.1.0.
403
235
 
404
- Placeholder option would be selected and disabled.
236
+ *Juanito Fatas*
405
237
 
406
- The HTML produced:
238
+ * Added `phone_to` helper method to create a link from mobile numbers.
407
239
 
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>
240
+ *Pietro Moro*
413
241
 
414
- *Sergey Prikhodko*
242
+ * annotated_source_code returns an empty array so TemplateErrors without a
243
+ template in the backtrace are surfaced properly by DebugExceptions.
415
244
 
416
- * Don't enforce UTF-8 by default.
245
+ *Guilherme Mansur*, *Kasper Timm Hansen*
417
246
 
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.
247
+ * Add autoload for SyntaxErrorInTemplate so syntax errors are correctly raised by DebugExceptions.
421
248
 
422
- *Andrew White*
249
+ *Guilherme Mansur*, *Gannon McGibbon*
423
250
 
424
- * Change translation key of `submit_tag` from `module_name_class_name` to `module_name/class_name`.
251
+ * `RenderingHelper` supports rendering objects that `respond_to?` `:render_in`.
425
252
 
426
- *Rui Onodera*
253
+ *Joel Hawksley*, *Natasha Umer*, *Aaron Patterson*, *Shawn Allen*, *Emily Plummer*, *Diana Mounter*, *John Hawthorn*, *Nathan Herald*, *Zaid Zawaideh*, *Zach Ahn*
427
254
 
428
- * Rails 6 requires Ruby 2.5.0 or newer.
255
+ * Fix `select_tag` so that it doesn't change `options` when `include_blank` is present.
429
256
 
430
- *Jeremy Daer*, *Kasper Timm Hansen*
257
+ *Younes SERRAJ*
431
258
 
432
259
 
433
- Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/actionview/CHANGELOG.md) for previous changes.
260
+ Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actionview/CHANGELOG.md) for previous changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2019 David Heinemeier Hansson
1
+ Copyright (c) 2004-2020 David Heinemeier Hansson
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -15,7 +15,7 @@ The latest version of Action View can be installed with RubyGems:
15
15
 
16
16
  Source code can be downloaded as part of the Rails project on GitHub:
17
17
 
18
- * https://github.com/rails/rails/tree/main/actionview
18
+ * https://github.com/rails/rails/tree/master/actionview
19
19
 
20
20
 
21
21
  == License