actionview 7.0.8.1 → 7.2.2.1

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 (96) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +60 -425
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +1 -1
  5. data/app/assets/javascripts/rails-ujs.esm.js +686 -0
  6. data/app/assets/javascripts/rails-ujs.js +630 -0
  7. data/lib/action_view/base.rb +52 -14
  8. data/lib/action_view/buffers.rb +106 -8
  9. data/lib/action_view/cache_expiry.rb +44 -41
  10. data/lib/action_view/context.rb +1 -1
  11. data/lib/action_view/dependency_tracker/{ripper_tracker.rb → ruby_tracker.rb} +4 -3
  12. data/lib/action_view/dependency_tracker.rb +1 -1
  13. data/lib/action_view/deprecator.rb +7 -0
  14. data/lib/action_view/digestor.rb +1 -1
  15. data/lib/action_view/gem_version.rb +3 -3
  16. data/lib/action_view/helpers/active_model_helper.rb +1 -1
  17. data/lib/action_view/helpers/asset_tag_helper.rb +151 -55
  18. data/lib/action_view/helpers/asset_url_helper.rb +6 -5
  19. data/lib/action_view/helpers/atom_feed_helper.rb +5 -5
  20. data/lib/action_view/helpers/cache_helper.rb +7 -13
  21. data/lib/action_view/helpers/capture_helper.rb +30 -10
  22. data/lib/action_view/helpers/content_exfiltration_prevention_helper.rb +70 -0
  23. data/lib/action_view/helpers/controller_helper.rb +6 -0
  24. data/lib/action_view/helpers/csp_helper.rb +2 -2
  25. data/lib/action_view/helpers/csrf_helper.rb +3 -3
  26. data/lib/action_view/helpers/date_helper.rb +17 -19
  27. data/lib/action_view/helpers/debug_helper.rb +3 -3
  28. data/lib/action_view/helpers/form_helper.rb +248 -214
  29. data/lib/action_view/helpers/form_options_helper.rb +2 -1
  30. data/lib/action_view/helpers/form_tag_helper.rb +125 -58
  31. data/lib/action_view/helpers/javascript_helper.rb +1 -0
  32. data/lib/action_view/helpers/number_helper.rb +37 -330
  33. data/lib/action_view/helpers/output_safety_helper.rb +6 -6
  34. data/lib/action_view/helpers/rendering_helper.rb +1 -1
  35. data/lib/action_view/helpers/sanitize_helper.rb +51 -21
  36. data/lib/action_view/helpers/tag_helper.rb +210 -42
  37. data/lib/action_view/helpers/tags/base.rb +11 -52
  38. data/lib/action_view/helpers/tags/collection_check_boxes.rb +1 -0
  39. data/lib/action_view/helpers/tags/collection_radio_buttons.rb +1 -0
  40. data/lib/action_view/helpers/tags/collection_select.rb +3 -0
  41. data/lib/action_view/helpers/tags/date_field.rb +1 -1
  42. data/lib/action_view/helpers/tags/date_select.rb +2 -0
  43. data/lib/action_view/helpers/tags/datetime_field.rb +14 -6
  44. data/lib/action_view/helpers/tags/datetime_local_field.rb +11 -2
  45. data/lib/action_view/helpers/tags/grouped_collection_select.rb +3 -0
  46. data/lib/action_view/helpers/tags/month_field.rb +1 -1
  47. data/lib/action_view/helpers/tags/select.rb +3 -0
  48. data/lib/action_view/helpers/tags/select_renderer.rb +56 -0
  49. data/lib/action_view/helpers/tags/time_field.rb +1 -1
  50. data/lib/action_view/helpers/tags/time_zone_select.rb +3 -0
  51. data/lib/action_view/helpers/tags/week_field.rb +1 -1
  52. data/lib/action_view/helpers/tags/weekday_select.rb +3 -0
  53. data/lib/action_view/helpers/tags.rb +2 -0
  54. data/lib/action_view/helpers/text_helper.rb +157 -85
  55. data/lib/action_view/helpers/translation_helper.rb +3 -3
  56. data/lib/action_view/helpers/url_helper.rb +35 -80
  57. data/lib/action_view/helpers.rb +2 -0
  58. data/lib/action_view/layouts.rb +8 -8
  59. data/lib/action_view/log_subscriber.rb +57 -36
  60. data/lib/action_view/lookup_context.rb +29 -13
  61. data/lib/action_view/path_registry.rb +57 -0
  62. data/lib/action_view/path_set.rb +13 -14
  63. data/lib/action_view/railtie.rb +25 -3
  64. data/lib/action_view/record_identifier.rb +15 -8
  65. data/lib/action_view/render_parser/prism_render_parser.rb +127 -0
  66. data/lib/action_view/render_parser/ripper_render_parser.rb +341 -0
  67. data/lib/action_view/render_parser.rb +21 -169
  68. data/lib/action_view/renderer/abstract_renderer.rb +2 -2
  69. data/lib/action_view/renderer/collection_renderer.rb +10 -2
  70. data/lib/action_view/renderer/partial_renderer/collection_caching.rb +2 -1
  71. data/lib/action_view/renderer/partial_renderer.rb +2 -1
  72. data/lib/action_view/renderer/renderer.rb +34 -38
  73. data/lib/action_view/renderer/streaming_template_renderer.rb +3 -2
  74. data/lib/action_view/renderer/template_renderer.rb +3 -2
  75. data/lib/action_view/rendering.rb +26 -8
  76. data/lib/action_view/template/error.rb +14 -1
  77. data/lib/action_view/template/handlers/builder.rb +4 -4
  78. data/lib/action_view/template/handlers/erb/erubi.rb +23 -27
  79. data/lib/action_view/template/handlers/erb.rb +73 -1
  80. data/lib/action_view/template/handlers.rb +1 -1
  81. data/lib/action_view/template/html.rb +1 -1
  82. data/lib/action_view/template/raw_file.rb +1 -1
  83. data/lib/action_view/template/renderable.rb +8 -2
  84. data/lib/action_view/template/resolver.rb +9 -3
  85. data/lib/action_view/template/text.rb +1 -1
  86. data/lib/action_view/template/types.rb +25 -34
  87. data/lib/action_view/template.rb +278 -55
  88. data/lib/action_view/template_path.rb +2 -0
  89. data/lib/action_view/test_case.rb +181 -28
  90. data/lib/action_view/unbound_template.rb +17 -7
  91. data/lib/action_view/version.rb +1 -1
  92. data/lib/action_view/view_paths.rb +15 -24
  93. data/lib/action_view.rb +4 -1
  94. metadata +31 -31
  95. data/lib/action_view/ripper_ast_parser.rb +0 -198
  96. data/lib/assets/compiled/rails-ujs.js +0 -777
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edd44fd0fda77cbf7800354655dc3c985e55979b180a35a161f40a82c56bebfb
4
- data.tar.gz: 5af263ab3bb410273b10936ee078a361a5b71f92f7616d3934f6ec3287123ee9
3
+ metadata.gz: 129f00c083e1a4443010be161169e51eea090543c6618289968ed2cdb1c65c76
4
+ data.tar.gz: 568d88d12f7fc363958af2f8bf45308199dc0c221a05fafb9415a96b3eaddc8a
5
5
  SHA512:
6
- metadata.gz: 45ceca59dcc1e0a91ea3916e0b8cef4b7f94bcd72e3ca89cf667a5df627635ee79fd0001b7c95d92589592adc274ee59f2456d676525ed03b7bf64b569db0f8b
7
- data.tar.gz: e16e31bb3dfb7399916dc4baa35959d6c619bae4bec93bb7284dbf7c1eb7fb30c6d0e602786b2a12eb994ce5c91a77e6ebd7fe4184827502bc7c451513624a99
6
+ metadata.gz: de08bd40788b58e9ba6be2169a5ebbc39c6b4f1122d1564b64cf0a6af066f855d4a1ad2d1721ab849fde78ee87c496c61579afd59d1a3062dba6135b6652bee4
7
+ data.tar.gz: cf2f5461be068f0d96d287bbdabe2daf9b3d76a4e80c9db31041d9242f77986b1d5d6774d6db95f5f2b068cbce2161b13335891bfd86d271994d49321bc88733
data/CHANGELOG.md CHANGED
@@ -1,498 +1,133 @@
1
- ## Rails 7.0.8.1 (February 21, 2024) ##
1
+ ## Rails 7.2.2.1 (December 10, 2024) ##
2
2
 
3
3
  * No changes.
4
4
 
5
5
 
6
- ## Rails 7.0.8 (September 09, 2023) ##
7
-
8
- * Fix `form_for` missing the hidden `_method` input for models with a
9
- namespaced route.
10
-
11
- *Hartley McGuire*
12
-
13
- * Fix `render collection: @records, cache: true` inside `jbuilder` templates
14
-
15
- The previous fix that shipped in `7.0.7` assumed template fragments are always strings,
16
- this isn't true with `jbuilder`.
17
-
18
- *Jean Boussier*
19
-
20
- ## Rails 7.0.7.2 (August 22, 2023) ##
6
+ ## Rails 7.2.2 (October 30, 2024) ##
21
7
 
22
8
  * No changes.
23
9
 
24
10
 
25
- ## Rails 7.0.7.1 (August 22, 2023) ##
11
+ ## Rails 7.2.1.2 (October 23, 2024) ##
26
12
 
27
13
  * No changes.
28
14
 
29
15
 
30
- ## Rails 7.0.7 (August 09, 2023) ##
31
-
32
- * Fix `render collection: @records, cache: true` to cache fragments as bare strings
33
-
34
- Previously it would incorrectly cache them as Action View buffers.
35
-
36
- *Jean Boussier*
37
-
38
- * Don't double-encode nested `field_id` and `field_name` index values
39
-
40
- Pass `index: @options` as a default keyword argument to `field_id` and
41
- `field_name` view helper methods.
42
-
43
- *Sean Doyle*
44
-
45
-
46
- ## Rails 7.0.6 (June 29, 2023) ##
16
+ ## Rails 7.2.1.1 (October 15, 2024) ##
47
17
 
48
18
  * No changes.
49
19
 
50
20
 
51
- ## Rails 7.0.5.1 (June 26, 2023) ##
21
+ ## Rails 7.2.1 (August 22, 2024) ##
52
22
 
53
23
  * No changes.
54
24
 
55
25
 
56
- ## Rails 7.0.5 (May 24, 2023) ##
26
+ ## Rails 7.2.0 (August 09, 2024) ##
57
27
 
58
- * `FormBuilder#id` finds id set by `form_for` and `form_with`.
28
+ * Fix templates with strict locals to also include `local_assigns`.
59
29
 
60
- *Matt Polito*
30
+ Previously templates defining strict locals wouldn't receive the `local_assigns`
31
+ hash.
61
32
 
62
- * Allow all available locales for template lookups.
63
-
64
- *Ben Dilley*
33
+ *Jean Boussier*
65
34
 
66
- * Choices of `select` can optionally contain html attributes as the last element
67
- of the child arrays when using grouped/nested collections
35
+ * Add queries count to template rendering instrumentation.
68
36
 
69
- ```erb
70
- <%= form.select :foo, [["North America", [["United States","US"],["Canada","CA"]], { disabled: "disabled" }]] %>
71
- # => <select><optgroup label="North America" disabled="disabled"><option value="US">United States</option><option value="CA">Canada</option></optgroup></select>
72
37
  ```
38
+ # Before
39
+ Completed 200 OK in 3804ms (Views: 41.0ms | ActiveRecord: 33.5ms | Allocations: 112788)
73
40
 
74
- *Chris Gunther*
75
-
76
-
77
- ## Rails 7.0.4.3 (March 13, 2023) ##
78
-
79
- * Ignore certain data-* attributes in rails-ujs when element is contenteditable
80
-
81
- [CVE-2023-23913]
82
-
83
-
84
- ## Rails 7.0.4.2 (January 24, 2023) ##
85
-
86
- * No changes.
87
-
88
-
89
- ## Rails 7.0.4.1 (January 17, 2023) ##
90
-
91
- * No changes.
92
-
93
-
94
- ## Rails 7.0.4 (September 09, 2022) ##
95
-
96
- * Guard against `ActionView::Helpers::FormTagHelper#field_name` calls with nil
97
- `object_name` arguments. For example:
98
-
99
- ```erb
100
- <%= fields do |f| %>
101
- <%= f.field_name :body %>
102
- <% end %>
41
+ # After
42
+ Completed 200 OK in 3804ms (Views: 41.0ms | ActiveRecord: 33.5ms (2 queries, 1 cached) | Allocations: 112788)
103
43
  ```
104
44
 
105
- *Sean Doyle*
106
-
107
- * Strings returned from `strip_tags` are correctly tagged `html_safe?`
108
-
109
- Because these strings contain no HTML elements and the basic entities are escaped, they are safe
110
- to be included as-is as PCDATA in HTML content. Tagging them as html-safe avoids double-escaping
111
- entities when being concatenated to a SafeBuffer during rendering.
112
-
113
- Fixes [rails/rails-html-sanitizer#124](https://github.com/rails/rails-html-sanitizer/issues/124)
114
-
115
- *Mike Dalessio*
116
-
117
- ## Rails 7.0.3.1 (July 12, 2022) ##
118
-
119
- * No changes.
120
-
45
+ *fatkodima*
121
46
 
122
- ## Rails 7.0.3 (May 09, 2022) ##
123
-
124
- * Ensure models passed to `form_for` attempt to call `to_model`.
47
+ * Raise `ArgumentError` if `:renderable` object does not respond to `#render_in`.
125
48
 
126
49
  *Sean Doyle*
127
50
 
128
- ## Rails 7.0.2.4 (April 26, 2022) ##
129
-
130
- * Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
131
-
132
- Escape dangerous characters in names of tags and names of attributes in the
133
- tag helpers, following the XML specification. Rename the option
134
- `:escape_attributes` to `:escape`, to simplify by applying the option to the
135
- whole tag.
136
-
137
- *Álvaro Martín Fraguas*
138
-
139
- ## Rails 7.0.2.3 (March 08, 2022) ##
140
-
141
- * No changes.
142
-
143
-
144
- ## Rails 7.0.2.2 (February 11, 2022) ##
145
-
146
- * No changes.
147
-
148
-
149
- ## Rails 7.0.2.1 (February 11, 2022) ##
150
-
151
- * No changes.
152
-
153
-
154
- ## Rails 7.0.2 (February 08, 2022) ##
155
-
156
- * Ensure `preload_link_tag` preloads JavaScript modules correctly.
157
-
158
- *Máximo Mussini*
159
-
160
- * Fix `stylesheet_link_tag` and similar helpers are being used to work in objects with
161
- a `response` method.
162
-
163
- *dark-panda*
164
-
165
-
166
- ## Rails 7.0.1 (January 06, 2022) ##
51
+ * Add the `nonce: true` option for `stylesheet_link_tag` helper to support automatic nonce generation for Content Security Policy.
167
52
 
168
- * Fix `button_to` to work with a hash parameter as URL.
53
+ Works the same way as `javascript_include_tag nonce: true` does.
169
54
 
170
- *MingyuanQin*
55
+ *Akhil G Krishnan*, *AJ Esler*
171
56
 
172
- * Fix `link_to` with a model passed as an argument twice.
173
-
174
- *Alex Ghiculescu*
175
-
176
-
177
- ## Rails 7.0.0 (December 15, 2021) ##
178
-
179
- * Support `include_hidden:` option in calls to
180
- `ActionView::Helper::FormBuilder#file_field` with `multiple: true` to
181
- support submitting an empty collection of files.
182
-
183
- ```ruby
184
- form.file_field :attachments, multiple: true
185
- # => <input type="hidden" autocomplete="off" name="post[attachments][]" value="">
186
- <input type="file" multiple="multiple" id="post_attachments" name="post[attachments][]">
187
-
188
- form.file_field :attachments, multiple: true, include_hidden: false
189
- # => <input type="file" multiple="multiple" id="post_attachments" name="post[attachments][]">
190
- ```
57
+ * Parse `ActionView::TestCase#rendered` HTML content as `Nokogiri::XML::DocumentFragment` instead of `Nokogiri::XML::Document`.
191
58
 
192
59
  *Sean Doyle*
193
60
 
194
- * Fix `number_with_precision(raise: true)` always raising even on valid numbers.
195
-
196
- *Pedro Moreira*
197
-
198
-
199
- ## Rails 7.0.0.rc3 (December 14, 2021) ##
61
+ * Rename `ActionView::TestCase::Behavior::Content` to `ActionView::TestCase::Behavior::RenderedViewContent`.
200
62
 
201
- * No changes.
202
-
203
-
204
- ## Rails 7.0.0.rc2 (December 14, 2021) ##
205
-
206
- * No changes.
207
-
208
- ## Rails 7.0.0.rc1 (December 06, 2021) ##
209
-
210
- * Support `fields model: [@nested, @model]` the same way as `form_with model:
211
- [@nested, @model]`.
63
+ Make `RenderedViewContent` inherit from `String`. Make private API with `:nodoc:`
212
64
 
213
65
  *Sean Doyle*
214
66
 
215
- * Infer HTTP verb `[method]` from a model or Array with model as the first
216
- argument to `button_to` when combined with a block:
67
+ * Deprecate passing `nil` as value for the `model:` argument to the `form_with` method.
217
68
 
218
- ```ruby
219
- button_to(Workshop.find(1)){ "Update" }
220
- #=> <form method="post" action="/workshops/1" class="button_to">
221
- #=> <input type="hidden" name="_method" value="patch" autocomplete="off" />
222
- #=> <button type="submit">Update</button>
223
- #=> </form>
224
-
225
- button_to([ Workshop.find(1), Session.find(1) ]) { "Update" }
226
- #=> <form method="post" action="/workshops/1/sessions/1" class="button_to">
227
- #=> <input type="hidden" name="_method" value="patch" autocomplete="off" />
228
- #=> <button type="submit">Update</button>
229
- #=> </form>
230
- ```
231
-
232
- *Sean Doyle*
69
+ *Collin Jilbert*
233
70
 
234
- * Support passing a Symbol as the first argument to `FormBuilder#button`:
235
-
236
- ```ruby
237
- form.button(:draft, value: true)
238
- # => <button name="post[draft]" value="true" type="submit">Create post</button>
239
-
240
- form.button(:draft, value: true) do
241
- content_tag(:strong, "Save as draft")
242
- end
243
- # => <button name="post[draft]" value="true" type="submit">
244
- # <strong>Save as draft</strong>
245
- # </button>
246
- ```
247
-
248
- *Sean Doyle*
249
-
250
- * Introduce the `field_name` view helper, along with the
251
- `FormBuilder#field_name` counterpart:
252
-
253
- ```ruby
254
- form_for @post do |f|
255
- f.field_tag :tag, name: f.field_name(:tag, multiple: true)
256
- # => <input type="text" name="post[tag][]">
257
- end
258
- ```
259
-
260
- *Sean Doyle*
261
-
262
- * Execute the `ActionView::Base.field_error_proc` within the context of the
263
- `ActionView::Base` instance:
264
-
265
- ```ruby
266
- config.action_view.field_error_proc = proc { |html| content_tag(:div, html, class: "field_with_errors") }
267
- ```
268
-
269
- *Sean Doyle*
270
-
271
- * Add support for `button_to ..., authenticity_token: false`
272
-
273
- ```ruby
274
- button_to "Create", Post.new, authenticity_token: false
275
- # => <form class="button_to" method="post" action="/posts"><button type="submit">Create</button></form>
276
-
277
- button_to "Create", Post.new, authenticity_token: true
278
- # => <form class="button_to" method="post" action="/posts"><button type="submit">Create</button><input type="hidden" name="form_token" value="abc123..." autocomplete="off" /></form>
279
-
280
- button_to "Create", Post.new, authenticity_token: "secret"
281
- # => <form class="button_to" method="post" action="/posts"><button type="submit">Create</button><input type="hidden" name="form_token" value="secret" autocomplete="off" /></form>
282
- ```
71
+ * Alias `field_set_tag` helper to `fieldset_tag` to match `<fieldset>` element.
283
72
 
284
73
  *Sean Doyle*
285
74
 
286
- * Support rendering `<form>` elements _without_ `[action]` attributes by:
287
-
288
- * `form_with url: false` or `form_with ..., html: { action: false }`
289
- * `form_for ..., url: false` or `form_for ..., html: { action: false }`
290
- * `form_tag false` or `form_tag ..., action: false`
291
- * `button_to "...", false` or `button_to(false) { ... }`
292
-
293
- *Sean Doyle*
294
-
295
- * Add `:day_format` option to `date_select`
296
-
297
- date_select("article", "written_on", day_format: ->(day) { day.ordinalize })
298
- # generates day options like <option value="1">1st</option>\n<option value="2">2nd</option>...
299
-
300
- *Shunichi Ikegami*
301
-
302
- * Allow `link_to` helper to infer link name from `Model#to_s` when it
303
- is used with a single argument:
304
-
305
- link_to @profile
306
- #=> <a href="/profiles/1">Eileen</a>
307
-
308
- This assumes the model class implements a `to_s` method like this:
309
-
310
- class Profile < ApplicationRecord
311
- # ...
312
- def to_s
313
- name
314
- end
315
- end
316
-
317
- Previously you had to supply a second argument even if the `Profile`
318
- model implemented a `#to_s` method that called the `name` method.
319
-
320
- link_to @profile, @profile.name
321
- #=> <a href="/profiles/1">Eileen</a>
322
-
323
- *Olivier Lacan*
324
-
325
- * Support svg unpaired tags for `tag` helper.
326
-
327
- tag.svg { tag.use('href' => "#cool-icon") }
328
- # => <svg><use href="#cool-icon"></svg>
329
-
330
- *Oleksii Vasyliev*
331
-
332
-
333
- ## Rails 7.0.0.alpha2 (September 15, 2021) ##
334
-
335
- * No changes.
336
-
337
-
338
- ## Rails 7.0.0.alpha1 (September 15, 2021) ##
75
+ * Deprecate passing content to void elements when using `tag.br` type tag builders.
339
76
 
340
- * Improves the performance of ActionView::Helpers::NumberHelper formatters by avoiding the use of
341
- exceptions as flow control.
342
-
343
- *Mike Dalessio*
344
-
345
- * `preload_link_tag` properly inserts `as` attributes for files with `image` MIME types, such as JPG or SVG.
346
-
347
- *Nate Berkopec*
348
-
349
- * Add `weekday_options_for_select` and `weekday_select` helper methods. Also adds `weekday_select` to `FormBuilder`.
350
-
351
- *Drew Bragg*, *Dana Kashubeck*, *Kasper Timm Hansen*
352
-
353
- * Add `caching?` helper that returns whether the current code path is being cached and `uncacheable!` to denote helper methods that can't participate in fragment caching.
354
-
355
- *Ben Toews*, *John Hawthorn*, *Kasper Timm Hansen*, *Joel Hawksley*
356
-
357
- * Add `include_seconds` option for `time_field`.
77
+ *Hartley McGuire*
358
78
 
359
- <%= form.time_field :foo, include_seconds: false %>
360
- # => <input value="16:22" type="time" />
79
+ * Fix the `number_to_human_size` view helper to correctly work with negative numbers.
361
80
 
362
- Default includes seconds:
81
+ *Earlopain*
363
82
 
364
- <%= form.time_field :foo %>
365
- # => <input value="16:22:01.440" type="time" />
83
+ * Automatically discard the implicit locals injected by collection rendering for template that can't accept them.
366
84
 
367
- This allows you to take advantage of [different rendering options](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time#time_value_format) in some browsers.
85
+ When rendering a collection, two implicit variables are injected, which breaks templates with strict locals.
368
86
 
369
- *Alex Ghiculescu*
87
+ Now they are only passed if the template will actually accept them.
370
88
 
371
- * Improve error messages when template file does not exist at absolute filepath.
89
+ *Yasha Krasnou*, *Jean Boussier*
372
90
 
373
- *Ted Whang*
91
+ * Fix `@rails/ujs` calling `start()` an extra time when using bundlers.
374
92
 
375
- * Add `:country_code` option to `sms_to` for consistency with `phone_to`.
93
+ *Hartley McGuire*, *Ryunosuke Sato*
376
94
 
377
- *Jonathan Hefner*
95
+ * Fix the `capture` view helper compatibility with HAML and Slim.
378
96
 
379
- * OpenSSL constants are now used for Digest computations.
97
+ When a blank string was captured in HAML or Slim (and possibly other template engines)
98
+ it would instead return the entire buffer.
380
99
 
381
- *Dirkjan Bussink*
100
+ *Jean Boussier*
382
101
 
383
- * The `translate` helper now passes `default` values that aren't
384
- translation keys through `I18n.translate` for interpolation.
102
+ * Updated `@rails/ujs` files to ignore certain data-* attributes when element is contenteditable.
385
103
 
386
- *Jonathan Hefner*
104
+ This fix was already landed in >= 7.0.4.3, < 7.1.0.
105
+ [[CVE-2023-23913](https://github.com/advisories/GHSA-xp5h-f8jf-rc8q)]
387
106
 
388
- * Adds option `extname` to `stylesheet_link_tag` to skip default
389
- `.css` extension appended to the stylesheet path.
107
+ *Ryunosuke Sato*
390
108
 
391
- Before:
109
+ * Added validation for HTML tag names in the `tag` and `content_tag` helper method.
392
110
 
393
- ```ruby
394
- stylesheet_link_tag "style.less"
395
- # <link href="/stylesheets/style.less.scss" rel="stylesheet">
396
- ```
111
+ The `tag` and `content_tag` method now checks that the provided tag name adheres to the HTML
112
+ specification. If an invalid HTML tag name is provided, the method raises an `ArgumentError`
113
+ with an appropriate error message.
397
114
 
398
- After:
115
+ Examples:
399
116
 
400
117
  ```ruby
401
- stylesheet_link_tag "style.less", extname: false, skip_pipeline: true, rel: "stylesheet/less"
402
- # <link href="/stylesheets/style.less" rel="stylesheet/less">
403
- ```
404
-
405
- *Abhay Nikam*
406
-
407
- * Deprecate `render` locals to be assigned to instance variables.
408
-
409
- *Petrik de Heus*
410
-
411
- * Remove legacy default `media=screen` from `stylesheet_link_tag`.
412
-
413
- *André Luis Leal Cardoso Junior*
414
-
415
- * Change `ActionView::Helpers::FormBuilder#button` to transform `formmethod`
416
- attributes into `_method="$VERB"` Form Data to enable varied same-form actions:
417
-
418
- <%= form_with model: post, method: :put do %>
419
- <%= form.button "Update" %>
420
- <%= form.button "Delete", formmethod: :delete %>
421
- <% end %>
422
- <%# => <form action="posts/1">
423
- => <input type="hidden" name="_method" value="put">
424
- => <button type="submit">Update</button>
425
- => <button type="submit" formmethod="post" name="_method" value="delete">Delete</button>
426
- => </form>
427
- %>
428
-
429
- *Sean Doyle*
118
+ # Raises ArgumentError: Invalid HTML5 tag name: 12p
119
+ content_tag("12p") # Starting with a number
430
120
 
431
- * Change `ActionView::Helpers::UrlHelper#button_to` to *always* render a
432
- `<button>` element, regardless of whether or not the content is passed as
433
- the first argument or as a block.
121
+ # Raises ArgumentError: Invalid HTML5 tag name: ""
122
+ content_tag("") # Empty tag name
434
123
 
435
- <%= button_to "Delete", post_path(@post), method: :delete %>
436
- # => <form action="/posts/1"><input type="hidden" name="_method" value="delete"><button type="submit">Delete</button></form>
124
+ # Raises ArgumentError: Invalid HTML5 tag name: div/
125
+ tag("div/") # Contains a solidus
437
126
 
438
- <%= button_to post_path(@post), method: :delete do %>
439
- Delete
440
- <% end %>
441
- # => <form action="/posts/1"><input type="hidden" name="_method" value="delete"><button type="submit">Delete</button></form>
442
-
443
- *Sean Doyle*, *Dusan Orlovic*
444
-
445
- * Add `config.action_view.preload_links_header` to allow disabling of
446
- the `Link` header being added by default when using `stylesheet_link_tag`
447
- and `javascript_include_tag`.
448
-
449
- *Andrew White*
450
-
451
- * The `translate` helper now resolves `default` values when a `nil` key is
452
- specified, instead of always returning `nil`.
453
-
454
- *Jonathan Hefner*
455
-
456
- * Add `config.action_view.image_loading` to configure the default value of
457
- the `image_tag` `:loading` option.
458
-
459
- By setting `config.action_view.image_loading = "lazy"`, an application can opt in to
460
- lazy loading images sitewide, without changing view code.
461
-
462
- *Jonathan Hefner*
463
-
464
- * `ActionView::Helpers::FormBuilder#id` returns the value
465
- of the `<form>` element's `id` attribute. With a `method` argument, returns
466
- the `id` attribute for a form field with that name.
467
-
468
- <%= form_for @post do |f| %>
469
- <%# ... %>
470
-
471
- <% content_for :sticky_footer do %>
472
- <%= form.button(form: f.id) %>
473
- <% end %>
474
- <% end %>
475
-
476
- *Sean Doyle*
477
-
478
- * `ActionView::Helpers::FormBuilder#field_id` returns the value generated by
479
- the FormBuilder for the given attribute name.
480
-
481
- <%= form_for @post do |f| %>
482
- <%= f.label :title %>
483
- <%= f.text_field :title, aria: { describedby: f.field_id(:title, :error) } %>
484
- <%= tag.span("is blank", id: f.field_id(:title, :error) %>
485
- <% end %>
486
-
487
- *Sean Doyle*
488
-
489
- * Add `tag.attributes` to transform a Hash into HTML Attributes, ready to be
490
- interpolated into ERB.
491
-
492
- <input <%= tag.attributes(type: :text, aria: { label: "Search" }) %> >
493
- # => <input type="text" aria-label="Search">
494
-
495
- *Sean Doyle*
127
+ # Raises ArgumentError: Invalid HTML5 tag name: "image file"
128
+ tag("image file") # Contains a space
129
+ ```
496
130
 
131
+ *Akhil G Krishnan*
497
132
 
498
- Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionview/CHANGELOG.md) for previous changes.
133
+ Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/actionview/CHANGELOG.md) for previous changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2022 David Heinemeier Hansson
1
+ Copyright (c) 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
@@ -5,7 +5,7 @@ view helpers that assist when building HTML forms, Atom feeds and more.
5
5
  Template formats that Action View handles are ERB (embedded Ruby, typically
6
6
  used to inline short Ruby snippets inside HTML), and XML Builder.
7
7
 
8
- You can read more about Action View in the {Action View Overview}[https://edgeguides.rubyonrails.org/action_view_overview.html] guide.
8
+ You can read more about Action View in the {Action View Overview}[https://guides.rubyonrails.org/action_view_overview.html] guide.
9
9
 
10
10
  == Download and installation
11
11