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