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