actionview 7.1.5.1 → 7.2.3

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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +100 -416
  3. data/README.rdoc +1 -1
  4. data/lib/action_view/base.rb +24 -9
  5. data/lib/action_view/cache_expiry.rb +9 -3
  6. data/lib/action_view/dependency_tracker/{ripper_tracker.rb → ruby_tracker.rb} +4 -3
  7. data/lib/action_view/dependency_tracker.rb +1 -1
  8. data/lib/action_view/digestor.rb +6 -2
  9. data/lib/action_view/gem_version.rb +3 -3
  10. data/lib/action_view/helpers/asset_tag_helper.rb +19 -7
  11. data/lib/action_view/helpers/atom_feed_helper.rb +1 -1
  12. data/lib/action_view/helpers/cache_helper.rb +2 -2
  13. data/lib/action_view/helpers/csrf_helper.rb +1 -1
  14. data/lib/action_view/helpers/date_helper.rb +8 -1
  15. data/lib/action_view/helpers/form_helper.rb +222 -217
  16. data/lib/action_view/helpers/form_options_helper.rb +6 -3
  17. data/lib/action_view/helpers/form_tag_helper.rb +80 -47
  18. data/lib/action_view/helpers/output_safety_helper.rb +5 -6
  19. data/lib/action_view/helpers/tag_helper.rb +208 -18
  20. data/lib/action_view/helpers/tags/collection_helpers.rb +2 -1
  21. data/lib/action_view/helpers/text_helper.rb +11 -4
  22. data/lib/action_view/helpers/url_helper.rb +3 -77
  23. data/lib/action_view/layouts.rb +8 -10
  24. data/lib/action_view/log_subscriber.rb +8 -4
  25. data/lib/action_view/railtie.rb +0 -1
  26. data/lib/action_view/render_parser/prism_render_parser.rb +127 -0
  27. data/lib/action_view/{ripper_ast_parser.rb → render_parser/ripper_render_parser.rb} +152 -9
  28. data/lib/action_view/render_parser.rb +21 -169
  29. data/lib/action_view/renderer/abstract_renderer.rb +1 -1
  30. data/lib/action_view/renderer/partial_renderer.rb +2 -2
  31. data/lib/action_view/renderer/renderer.rb +32 -38
  32. data/lib/action_view/renderer/template_renderer.rb +3 -3
  33. data/lib/action_view/rendering.rb +4 -4
  34. data/lib/action_view/template/error.rb +11 -0
  35. data/lib/action_view/template/handlers/erb.rb +45 -37
  36. data/lib/action_view/template/renderable.rb +7 -1
  37. data/lib/action_view/template/resolver.rb +0 -2
  38. data/lib/action_view/template.rb +36 -8
  39. data/lib/action_view/test_case.rb +7 -10
  40. data/lib/action_view.rb +1 -0
  41. metadata +30 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 81ab3c1fd87fbc6f3f4a09d1144364f7c86371f864de4f7b88a4a96964b91b2a
4
- data.tar.gz: c09302122b22d24541386865a278ad1b72a988b08a9808375442470c674488ab
3
+ metadata.gz: 773338461dd6a54e8b6efa075c2be80d8f8c975ee46bd2167bc7e2fcd8e78f35
4
+ data.tar.gz: 22244120a030dfc49034d8d790fa86013b1de42b5ee7acbe75243580c9eec7c1
5
5
  SHA512:
6
- metadata.gz: df946293efa603d2e519d7acea52ea8565fac8b266aab767e2a5d655b4ed3235f5203f703fc7679323dab4137bc1087abaaeb26f77a5e4d0012a1ea9e03630d0
7
- data.tar.gz: 01e8fd7e08c61c5463bbcafedd9813fcaa655b75b63406eefc6724fd78333ae2d0c943b7b651273d4edbd80b24efc82419976a38d103a62f6c4ae3cc37f2ce62
6
+ metadata.gz: 1c26e2052e3f599c7f28c19892948c6b3f8cdeef005a4dc54762b4e74309ac32ef794115b0e46d2364624b26debb85a6aaebc938813d08e69e9c670c3bf79ae6
7
+ data.tar.gz: 15bdc1f27280a327a1270ddf794b484d68f88af959c2d49361ef0e33c37e547b81166c8b92ef400f7e9a62c8192820bd58042733335ff4a9c3f1a77b660f775f
data/CHANGELOG.md CHANGED
@@ -1,516 +1,200 @@
1
- ## Rails 7.1.5.1 (December 10, 2024) ##
1
+ ## Rails 7.2.3 (October 28, 2025) ##
2
2
 
3
- * No changes.
4
-
5
-
6
- ## Rails 7.1.5 (October 30, 2024) ##
7
-
8
- * No changes.
9
-
10
-
11
- ## Rails 7.1.4.2 (October 23, 2024) ##
12
-
13
- * No changes.
14
-
15
-
16
- ## Rails 7.1.4.1 (October 15, 2024) ##
17
-
18
- * No changes.
3
+ * Fix `javascript_include_tag` `type` option to accept either strings and symbols.
19
4
 
5
+ ```ruby
6
+ javascript_include_tag "application", type: :module
7
+ javascript_include_tag "application", type: "module"
8
+ ```
20
9
 
21
- ## Rails 7.1.4 (August 22, 2024) ##
22
-
23
- * Action View Test Case `rendered` memoization.
24
-
25
- *Sean Doyle*
26
-
27
- * Restore the ability for templates to return any kind of object and not just strings
10
+ Previously, only the string value was recoginized.
28
11
 
29
12
  *Jean Boussier*
30
13
 
31
- * Fix threading issue with strict locals.
32
-
33
- *Robert Fletcher*
34
-
35
-
36
- ## Rails 7.1.3.4 (June 04, 2024) ##
37
-
38
- * No changes.
39
-
40
-
41
- ## Rails 7.1.3.3 (May 16, 2024) ##
42
-
43
- * No changes.
44
-
45
-
46
- ## Rails 7.1.3.2 (February 21, 2024) ##
47
-
48
- * No changes.
49
-
50
-
51
- ## Rails 7.1.3.1 (February 21, 2024) ##
52
-
53
- * No changes.
54
-
55
-
56
- ## Rails 7.1.3 (January 16, 2024) ##
57
-
58
- * Better handle SyntaxError in Action View.
59
-
60
- *Mario Caropreso*
61
-
62
- * Fix `word_wrap` with empty string.
14
+ * Fix `excerpt` helper with non-whitespace separator.
63
15
 
64
16
  *Jonathan Hefner*
65
17
 
66
- * Rename `ActionView::TestCase::Behavior::Content` to `ActionView::TestCase::Behavior::RenderedViewContent`.
67
-
68
- Make `RenderedViewContent` inherit from `String`. Make private API with `:nodoc:`.
69
-
70
- *Sean Doyle*
71
-
72
- * Fix detection of required strict locals.
73
-
74
- Further fix `render @collection` compatibility with strict locals
75
-
76
- *Jean Boussier*
77
-
18
+ * Respect `html_options[:form]` when `collection_checkboxes` generates the
19
+ hidden `<input>`.
78
20
 
79
- ## Rails 7.1.2 (November 10, 2023) ##
21
+ *Riccardo Odone*
80
22
 
81
- * Fix the `number_to_human_size` view helper to correctly work with negative numbers.
23
+ * Layouts have access to local variables passed to `render`.
82
24
 
83
- *Earlopain*
25
+ This fixes #31680 which was a regression in Rails 5.1.
84
26
 
85
- * Automatically discard the implicit locals injected by collection rendering for template that can't accept them
27
+ *Mike Dalessio*
86
28
 
87
- When rendering a collection, two implicit variables are injected, which breaks templates with strict locals.
29
+ * Argument errors related to strict locals in templates now raise an
30
+ `ActionView::StrictLocalsError`, and all other argument errors are reraised as-is.
88
31
 
89
- Now they are only passed if the template will actually accept them.
32
+ Previously, any `ArgumentError` raised during template rendering was swallowed during strict
33
+ local error handling, so that an `ArgumentError` unrelated to strict locals (e.g., a helper
34
+ method invoked with incorrect arguments) would be replaced by a similar `ArgumentError` with an
35
+ unrelated backtrace, making it difficult to debug templates.
90
36
 
91
- *Yasha Krasnou*, *Jean Boussier*
37
+ Now, any `ArgumentError` unrelated to strict locals is reraised, preserving the original
38
+ backtrace for developers.
92
39
 
93
- * Fix `@rails/ujs` calling `start()` an extra time when using bundlers
40
+ Also note that `ActionView::StrictLocalsError` is a subclass of `ArgumentError`, so any existing
41
+ code that rescues `ArgumentError` will continue to work.
94
42
 
95
- *Hartley McGuire*, *Ryunosuke Sato*
43
+ Fixes #52227.
96
44
 
97
- * Fix the `capture` view helper compatibility with HAML and Slim
45
+ *Mike Dalessio*
98
46
 
99
- When a blank string was captured in HAML or Slim (and possibly other template engines)
100
- it would instead return the entire buffer.
47
+ * Fix stack overflow error in dependency tracker when dealing with circular dependencies
101
48
 
102
49
  *Jean Boussier*
103
50
 
51
+ * Fix a crash in ERB template error highlighting when the error occurs on a
52
+ line in the compiled template that is past the end of the source template.
104
53
 
105
- ## Rails 7.1.1 (October 11, 2023) ##
54
+ *Martin Emde*
106
55
 
107
- * Updated `@rails/ujs` files to ignore certain data-* attributes when element is contenteditable.
56
+ * Improve reliability of ERB template error highlighting.
57
+ Fix infinite loops and crashes in highlighting and
58
+ improve tolerance for alternate ERB handlers.
108
59
 
109
- This fix was already landed in >= 7.0.4.3, < 7.1.0.
110
- [[CVE-2023-23913](https://github.com/advisories/GHSA-xp5h-f8jf-rc8q)]
111
-
112
- *Ryunosuke Sato*
60
+ *Martin Emde*
113
61
 
114
62
 
115
- ## Rails 7.1.0 (October 05, 2023) ##
63
+ ## Rails 7.2.2.2 (August 13, 2025) ##
116
64
 
117
65
  * No changes.
118
66
 
119
67
 
120
- ## Rails 7.1.0.rc2 (October 01, 2023) ##
68
+ ## Rails 7.2.2.1 (December 10, 2024) ##
121
69
 
122
70
  * No changes.
123
71
 
124
72
 
125
- ## Rails 7.1.0.rc1 (September 27, 2023) ##
126
-
127
- * Introduce `ActionView::TestCase.register_parser`
128
-
129
- ```ruby
130
- register_parser :rss, -> rendered { RSS::Parser.parse(rendered) }
131
-
132
- test "renders RSS" do
133
- article = Article.create!(title: "Hello, world")
134
-
135
- render formats: :rss, partial: article
136
-
137
- assert_equal "Hello, world", rendered.rss.items.last.title
138
- end
139
- ```
140
-
141
- By default, register parsers for `:html` and `:json`.
73
+ ## Rails 7.2.2 (October 30, 2024) ##
142
74
 
143
- *Sean Doyle*
144
-
145
-
146
- ## Rails 7.1.0.beta1 (September 13, 2023) ##
147
-
148
- * Fix `simple_format` with blank `wrapper_tag` option returns plain html tag
149
-
150
- By default `simple_format` method returns the text wrapped with `<p>`. But if we explicitly specify
151
- the `wrapper_tag: nil` in the options, it returns the text wrapped with `<></>` tag.
152
-
153
- Before:
154
-
155
- ```ruby
156
- simple_format("Hello World", {}, { wrapper_tag: nil })
157
- # <>Hello World</>
158
- ```
75
+ * No changes.
159
76
 
160
- After:
161
77
 
162
- ```ruby
163
- simple_format("Hello World", {}, { wrapper_tag: nil })
164
- # <p>Hello World</p>
165
- ```
78
+ ## Rails 7.2.1.2 (October 23, 2024) ##
166
79
 
167
- *Akhil G Krishnan*, *Junichi Ito*
80
+ * No changes.
168
81
 
169
- * Don't double-encode nested `field_id` and `field_name` index values
170
82
 
171
- Pass `index: @options` as a default keyword argument to `field_id` and
172
- `field_name` view helper methods.
83
+ ## Rails 7.2.1.1 (October 15, 2024) ##
173
84
 
174
- *Sean Doyle*
85
+ * No changes.
175
86
 
176
- * Allow opting in/out of `Link preload` headers when calling `stylesheet_link_tag` or `javascript_include_tag`
177
87
 
178
- ```ruby
179
- # will exclude header, even if setting is enabled:
180
- javascript_include_tag("http://example.com/all.js", preload_links_header: false)
88
+ ## Rails 7.2.1 (August 22, 2024) ##
181
89
 
182
- # will include header, even if setting is disabled:
183
- stylesheet_link_tag("http://example.com/all.js", preload_links_header: true)
184
- ```
90
+ * No changes.
185
91
 
186
- *Alex Ghiculescu*
187
92
 
188
- * Stop generating `Link preload` headers once it has reached 1KB.
93
+ ## Rails 7.2.0 (August 09, 2024) ##
189
94
 
190
- Some proxies have trouble handling large headers, but more importantly preload links
191
- have diminishing returns so it's preferable not to go overboard with them.
95
+ * Fix templates with strict locals to also include `local_assigns`.
192
96
 
193
- If tighter control is needed, it's recommended to disable automatic generation of preloads
194
- and to generate them manually from the controller or from a middleware.
97
+ Previously templates defining strict locals wouldn't receive the `local_assigns`
98
+ hash.
195
99
 
196
100
  *Jean Boussier*
197
101
 
198
- * `simple_format` helper now handles a `:sanitize_options` - any extra options you want appending to the sanitize.
102
+ * Add queries count to template rendering instrumentation.
199
103
 
200
- Before:
201
- ```ruby
202
- simple_format("<a target=\"_blank\" href=\"http://example.com\">Continue</a>")
203
- # => "<p><a href=\"http://example.com\">Continue</a></p>"
204
104
  ```
105
+ # Before
106
+ Completed 200 OK in 3804ms (Views: 41.0ms | ActiveRecord: 33.5ms | Allocations: 112788)
205
107
 
206
- After:
207
- ```ruby
208
- simple_format("<a target=\"_blank\" href=\"http://example.com\">Continue</a>", {}, { sanitize_options: { attributes: %w[target href] } })
209
- # => "<p><a target=\"_blank\" href=\"http://example.com\">Continue</a></p>"
108
+ # After
109
+ Completed 200 OK in 3804ms (Views: 41.0ms | ActiveRecord: 33.5ms (2 queries, 1 cached) | Allocations: 112788)
210
110
  ```
211
111
 
212
- *Andrei Andriichuk*
213
-
214
- * Add support for HTML5 standards-compliant sanitizers, and default to `Rails::HTML5::Sanitizer`
215
- in the Rails 7.1 configuration if it is supported.
216
-
217
- Action View's HTML sanitizers can be configured by setting
218
- `config.action_view.sanitizer_vendor`. Supported values are `Rails::HTML4::Sanitizer` or
219
- `Rails::HTML5::Sanitizer`.
220
-
221
- The Rails 7.1 configuration will set this to `Rails::HTML5::Sanitizer` when it is supported, and
222
- fall back to `Rails::HTML4::Sanitizer`. Previous configurations default to
223
- `Rails::HTML4::Sanitizer`.
224
-
225
- *Mike Dalessio*
226
-
227
- * `config.dom_testing_default_html_version` controls the HTML parser used by
228
- `ActionView::TestCase#document_root_element`, which creates the DOM used by the assertions in
229
- Rails::Dom::Testing.
230
-
231
- The Rails 7.1 default configuration opts into the HTML5 parser when it is supported, to better
232
- represent what the DOM would be in a browser user agent. Previously this test helper always used
233
- Nokogiri's HTML4 parser.
234
-
235
- *Mike Dalessio*
112
+ *fatkodima*
236
113
 
237
- * Add support for the HTML picture tag. It supports passing a String, an Array or a Block.
238
- Supports passing properties directly to the img tag via the `:image` key.
239
- Since the picture tag requires an img tag, the last element you provide will be used for the img tag.
240
- For complete control over the picture tag, a block can be passed, which will populate the contents of the tag accordingly.
241
-
242
- Can be used like this for a single source:
243
- ```erb
244
- <%= picture_tag("picture.webp") %>
245
- ```
246
- which will generate the following:
247
- ```html
248
- <picture>
249
- <img src="/images/picture.webp" />
250
- </picture>
251
- ```
114
+ * Raise `ArgumentError` if `:renderable` object does not respond to `#render_in`.
252
115
 
253
- For multiple sources:
254
- ```erb
255
- <%= picture_tag("picture.webp", "picture.png", :class => "mt-2", :image => { alt: "Image", class: "responsive-img" }) %>
256
- ```
257
- will generate:
258
- ```html
259
- <picture class="mt-2">
260
- <source srcset="/images/picture.webp" />
261
- <source srcset="/images/picture.png" />
262
- <img alt="Image" class="responsive-img" src="/images/picture.png" />
263
- </picture>
264
- ```
116
+ *Sean Doyle*
265
117
 
266
- Full control via a block:
267
- ```erb
268
- <%= picture_tag(:class => "my-class") do %>
269
- <%= tag(:source, :srcset => image_path("picture.webp")) %>
270
- <%= tag(:source, :srcset => image_path("picture.png")) %>
271
- <%= image_tag("picture.png", :alt => "Image") %>
272
- <% end %>
273
- ```
274
- will generate:
275
- ```html
276
- <picture class="my-class">
277
- <source srcset="/images/picture.webp" />
278
- <source srcset="/images/picture.png" />
279
- <img alt="Image" src="/images/picture.png" />
280
- </picture>
281
- ```
118
+ * Add the `nonce: true` option for `stylesheet_link_tag` helper to support automatic nonce generation for Content Security Policy.
282
119
 
283
- *Juan Pablo Balarini*
120
+ Works the same way as `javascript_include_tag nonce: true` does.
284
121
 
285
- * Remove deprecated support to passing instance variables as locals to partials.
122
+ *Akhil G Krishnan*, *AJ Esler*
286
123
 
287
- *Rafael Mendonça França*
124
+ * Parse `ActionView::TestCase#rendered` HTML content as `Nokogiri::XML::DocumentFragment` instead of `Nokogiri::XML::Document`.
288
125
 
289
- * Remove deprecated constant `ActionView::Path`.
126
+ *Sean Doyle*
290
127
 
291
- *Rafael Mendonça França*
128
+ * Rename `ActionView::TestCase::Behavior::Content` to `ActionView::TestCase::Behavior::RenderedViewContent`.
292
129
 
293
- * Guard `token_list` calls from escaping HTML too often
130
+ Make `RenderedViewContent` inherit from `String`. Make private API with `:nodoc:`
294
131
 
295
132
  *Sean Doyle*
296
133
 
297
- * `select` can now be called with a single hash containing options and some HTML options
298
-
299
- Previously this would not work as expected:
300
-
301
- ```erb
302
- <%= select :post, :author, authors, required: true %>
303
- ```
134
+ * Deprecate passing `nil` as value for the `model:` argument to the `form_with` method.
304
135
 
305
- Instead you needed to do this:
136
+ *Collin Jilbert*
306
137
 
307
- ```erb
308
- <%= select :post, :author, authors, {}, required: true %>
309
- ```
138
+ * Alias `field_set_tag` helper to `fieldset_tag` to match `<fieldset>` element.
310
139
 
311
- Now, either form is accepted, for the following HTML attributes: `required`, `multiple`, `size`.
140
+ *Sean Doyle*
312
141
 
313
- *Alex Ghiculescu*
142
+ * Deprecate passing content to void elements when using `tag.br` type tag builders.
314
143
 
315
- * Datetime form helpers (`time_field`, `date_field`, `datetime_field`, `week_field`, `month_field`) now accept an instance of Time/Date/DateTime as `:value` option.
144
+ *Hartley McGuire*
316
145
 
317
- Before:
318
- ```erb
319
- <%= form.datetime_field :written_at, value: Time.current.strftime("%Y-%m-%dT%T") %>
320
- ```
146
+ * Fix the `number_to_human_size` view helper to correctly work with negative numbers.
321
147
 
322
- After:
323
- ```erb
324
- <%= form.datetime_field :written_at, value: Time.current %>
325
- ```
148
+ *Earlopain*
326
149
 
327
- *Andrey Samsonov*
150
+ * Automatically discard the implicit locals injected by collection rendering for template that can't accept them.
328
151
 
329
- * Choices of `select` can optionally contain html attributes as the last element
330
- of the child arrays when using grouped/nested collections
152
+ When rendering a collection, two implicit variables are injected, which breaks templates with strict locals.
331
153
 
332
- ```erb
333
- <%= form.select :foo, [["North America", [["United States","US"],["Canada","CA"]], { disabled: "disabled" }]] %>
334
- # => <select><optgroup label="North America" disabled="disabled"><option value="US">United States</option><option value="CA">Canada</option></optgroup></select>
335
- ```
154
+ Now they are only passed if the template will actually accept them.
336
155
 
337
- *Chris Gunther*
156
+ *Yasha Krasnou*, *Jean Boussier*
338
157
 
339
- * `check_box_tag` and `radio_button_tag` now accept `checked` as a keyword argument
158
+ * Fix `@rails/ujs` calling `start()` an extra time when using bundlers.
340
159
 
341
- This is to make the API more consistent with the `FormHelper` variants. You can now
342
- provide `checked` as a positional or keyword argument:
160
+ *Hartley McGuire*, *Ryunosuke Sato*
343
161
 
344
- ```erb
345
- = check_box_tag "admin", "1", false
346
- = check_box_tag "admin", "1", checked: false
162
+ * Fix the `capture` view helper compatibility with HAML and Slim.
347
163
 
348
- = radio_button_tag 'favorite_color', 'maroon', false
349
- = radio_button_tag 'favorite_color', 'maroon', checked: false
350
- ```
164
+ When a blank string was captured in HAML or Slim (and possibly other template engines)
165
+ it would instead return the entire buffer.
351
166
 
352
- *Alex Ghiculescu*
167
+ *Jean Boussier*
353
168
 
354
- * Allow passing a class to `dom_id`.
355
- You no longer need to call `new` when passing a class to `dom_id`.
356
- This makes `dom_id` behave like `dom_class` in this regard.
357
- Apart from saving a few keystrokes, it prevents Ruby from needing
358
- to instantiate a whole new object just to generate a string.
169
+ * Updated `@rails/ujs` files to ignore certain data-* attributes when element is contenteditable.
359
170
 
360
- Before:
361
- ```ruby
362
- dom_id(Post) # => NoMethodError: undefined method `to_key' for Post:Class
363
- ```
171
+ This fix was already landed in >= 7.0.4.3, < 7.1.0.
172
+ [[CVE-2023-23913](https://github.com/advisories/GHSA-xp5h-f8jf-rc8q)]
364
173
 
365
- After:
366
- ```ruby
367
- dom_id(Post) # => "new_post"
368
- ```
174
+ *Ryunosuke Sato*
369
175
 
370
- *Goulven Champenois*
176
+ * Added validation for HTML tag names in the `tag` and `content_tag` helper method.
371
177
 
372
- * Report `:locals` as part of the data returned by ActionView render instrumentation.
178
+ The `tag` and `content_tag` method now checks that the provided tag name adheres to the HTML
179
+ specification. If an invalid HTML tag name is provided, the method raises an `ArgumentError`
180
+ with an appropriate error message.
373
181
 
374
- Before:
375
- ```ruby
376
- {
377
- identifier: "/Users/adam/projects/notifications/app/views/posts/index.html.erb",
378
- layout: "layouts/application"
379
- }
380
- ```
182
+ Examples:
381
183
 
382
- After:
383
184
  ```ruby
384
- {
385
- identifier: "/Users/adam/projects/notifications/app/views/posts/index.html.erb",
386
- layout: "layouts/application",
387
- locals: {foo: "bar"}
388
- }
389
- ```
390
-
391
- *Aaron Gough*
392
-
393
- * Strip `break_sequence` at the end of `word_wrap`.
394
-
395
- This fixes a bug where `word_wrap` didn't properly strip off break sequences that had printable characters.
396
-
397
- For example, compare the outputs of this template:
398
-
399
- ```erb
400
- # <%= word_wrap("11 22\n33 44", line_width: 2, break_sequence: "\n# ") %>
401
- ```
185
+ # Raises ArgumentError: Invalid HTML5 tag name: 12p
186
+ content_tag("12p") # Starting with a number
402
187
 
403
- Before:
188
+ # Raises ArgumentError: Invalid HTML5 tag name: ""
189
+ content_tag("") # Empty tag name
404
190
 
405
- ```
406
- # 11
407
- # 22
408
- #
409
- # 33
410
- # 44
411
- #
412
- ```
191
+ # Raises ArgumentError: Invalid HTML5 tag name: div/
192
+ tag("div/") # Contains a solidus
413
193
 
414
- After:
415
-
416
- ```
417
- # 11
418
- # 22
419
- # 33
420
- # 44
194
+ # Raises ArgumentError: Invalid HTML5 tag name: "image file"
195
+ tag("image file") # Contains a space
421
196
  ```
422
197
 
423
- *Max Chernyak*
424
-
425
- * Allow templates to set strict `locals`.
426
-
427
- By default, templates will accept any `locals` as keyword arguments. To define what `locals` a template accepts, add a `locals` magic comment:
428
-
429
- ```erb
430
- <%# locals: (message:) -%>
431
- <%= message %>
432
- ```
433
-
434
- Default values can also be provided:
435
-
436
- ```erb
437
- <%# locals: (message: "Hello, world!") -%>
438
- <%= message %>
439
- ```
440
-
441
- Or `locals` can be disabled entirely:
442
-
443
- ```erb
444
- <%# locals: () %>
445
- ```
446
-
447
- *Joel Hawksley*
448
-
449
- * Add `include_seconds` option for `datetime_local_field`
450
-
451
- This allows to omit seconds part in the input field, by passing `include_seconds: false`
452
-
453
- *Wojciech Wnętrzak*
454
-
455
- * Guard against `ActionView::Helpers::FormTagHelper#field_name` calls with nil
456
- `object_name` arguments. For example:
457
-
458
- ```erb
459
- <%= fields do |f| %>
460
- <%= f.field_name :body %>
461
- <% end %>
462
- ```
463
-
464
- *Sean Doyle*
465
-
466
- * Strings returned from `strip_tags` are correctly tagged `html_safe?`
467
-
468
- Because these strings contain no HTML elements and the basic entities are escaped, they are safe
469
- to be included as-is as PCDATA in HTML content. Tagging them as html-safe avoids double-escaping
470
- entities when being concatenated to a SafeBuffer during rendering.
471
-
472
- Fixes [rails/rails-html-sanitizer#124](https://github.com/rails/rails-html-sanitizer/issues/124)
473
-
474
- *Mike Dalessio*
475
-
476
- * Move `convert_to_model` call from `form_for` into `form_with`
477
-
478
- Now that `form_for` is implemented in terms of `form_with`, remove the
479
- `convert_to_model` call from `form_for`.
480
-
481
- *Sean Doyle*
482
-
483
- * Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
484
-
485
- Escape dangerous characters in names of tags and names of attributes in the
486
- tag helpers, following the XML specification. Rename the option
487
- `:escape_attributes` to `:escape`, to simplify by applying the option to the
488
- whole tag.
489
-
490
- *Álvaro Martín Fraguas*
491
-
492
- * Extend audio_tag and video_tag to accept Active Storage attachments.
493
-
494
- Now it's possible to write
495
-
496
- ```ruby
497
- audio_tag(user.audio_file)
498
- video_tag(user.video_file)
499
- ```
500
-
501
- Instead of
502
-
503
- ```ruby
504
- audio_tag(polymorphic_path(user.audio_file))
505
- video_tag(polymorphic_path(user.video_file))
506
- ```
507
-
508
- `image_tag` already supported that, so this follows the same pattern.
509
-
510
- *Matheus Richard*
511
-
512
- * Ensure models passed to `form_for` attempt to call `to_model`.
513
-
514
- *Sean Doyle*
198
+ *Akhil G Krishnan*
515
199
 
516
- Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/actionview/CHANGELOG.md) for previous changes.
200
+ Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/actionview/CHANGELOG.md) for previous changes.
data/README.rdoc CHANGED
@@ -35,6 +35,6 @@ Bug reports for the Ruby on \Rails project can be filed here:
35
35
 
36
36
  * https://github.com/rails/rails/issues
37
37
 
38
- Feature requests should be discussed on the rails-core mailing list here:
38
+ Feature requests should be discussed on the rubyonrails-core forum here:
39
39
 
40
40
  * https://discuss.rubyonrails.org/c/rubyonrails-core