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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +60 -425
- 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 +3 -3
- 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/render_parser/ripper_render_parser.rb +341 -0
- 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 +31 -31
- data/lib/action_view/ripper_ast_parser.rb +0 -198
- 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,498 +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.
|
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.
|
11
|
+
## Rails 7.2.1.2 (October 23, 2024) ##
|
26
12
|
|
27
13
|
* No changes.
|
28
14
|
|
29
15
|
|
30
|
-
## Rails 7.
|
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.
|
21
|
+
## Rails 7.2.1 (August 22, 2024) ##
|
52
22
|
|
53
23
|
* No changes.
|
54
24
|
|
55
25
|
|
56
|
-
## Rails 7.0
|
26
|
+
## Rails 7.2.0 (August 09, 2024) ##
|
57
27
|
|
58
|
-
*
|
28
|
+
* Fix templates with strict locals to also include `local_assigns`.
|
59
29
|
|
60
|
-
|
30
|
+
Previously templates defining strict locals wouldn't receive the `local_assigns`
|
31
|
+
hash.
|
61
32
|
|
62
|
-
*
|
63
|
-
|
64
|
-
*Ben Dilley*
|
33
|
+
*Jean Boussier*
|
65
34
|
|
66
|
-
*
|
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
|
-
|
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
|
-
*
|
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
|
-
|
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
|
-
|
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
|
-
|
53
|
+
Works the same way as `javascript_include_tag nonce: true` does.
|
169
54
|
|
170
|
-
*
|
55
|
+
*Akhil G Krishnan*, *AJ Esler*
|
171
56
|
|
172
|
-
*
|
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
|
-
*
|
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
|
-
|
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
|
-
*
|
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
|
-
|
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
|
-
*
|
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
|
-
*
|
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
|
-
*
|
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
|
-
|
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
|
-
|
81
|
+
*Earlopain*
|
363
82
|
|
364
|
-
|
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
|
-
|
85
|
+
When rendering a collection, two implicit variables are injected, which breaks templates with strict locals.
|
368
86
|
|
369
|
-
|
87
|
+
Now they are only passed if the template will actually accept them.
|
370
88
|
|
371
|
-
*
|
89
|
+
*Yasha Krasnou*, *Jean Boussier*
|
372
90
|
|
373
|
-
|
91
|
+
* Fix `@rails/ujs` calling `start()` an extra time when using bundlers.
|
374
92
|
|
375
|
-
*
|
93
|
+
*Hartley McGuire*, *Ryunosuke Sato*
|
376
94
|
|
377
|
-
|
95
|
+
* Fix the `capture` view helper compatibility with HAML and Slim.
|
378
96
|
|
379
|
-
|
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
|
-
*
|
100
|
+
*Jean Boussier*
|
382
101
|
|
383
|
-
*
|
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
|
-
|
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
|
-
*
|
389
|
-
`.css` extension appended to the stylesheet path.
|
107
|
+
*Ryunosuke Sato*
|
390
108
|
|
391
|
-
|
109
|
+
* Added validation for HTML tag names in the `tag` and `content_tag` helper method.
|
392
110
|
|
393
|
-
|
394
|
-
|
395
|
-
|
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
|
-
|
115
|
+
Examples:
|
399
116
|
|
400
117
|
```ruby
|
401
|
-
|
402
|
-
#
|
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
|
-
|
432
|
-
|
433
|
-
the first argument or as a block.
|
121
|
+
# Raises ArgumentError: Invalid HTML5 tag name: ""
|
122
|
+
content_tag("") # Empty tag name
|
434
123
|
|
435
|
-
|
436
|
-
|
124
|
+
# Raises ArgumentError: Invalid HTML5 tag name: div/
|
125
|
+
tag("div/") # Contains a solidus
|
437
126
|
|
438
|
-
|
439
|
-
|
440
|
-
|
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 [
|
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
|
|