actionview 5.1.7 → 5.2.8.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionview might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +119 -178
- data/MIT-LICENSE +1 -1
- data/README.rdoc +4 -4
- data/lib/action_view/base.rb +8 -10
- data/lib/action_view/buffers.rb +2 -0
- data/lib/action_view/context.rb +2 -2
- data/lib/action_view/dependency_tracker.rb +2 -0
- data/lib/action_view/digestor.rb +7 -7
- data/lib/action_view/flows.rb +2 -0
- data/lib/action_view/gem_version.rb +5 -3
- data/lib/action_view/helpers/active_model_helper.rb +9 -3
- data/lib/action_view/helpers/asset_tag_helper.rb +180 -34
- data/lib/action_view/helpers/asset_url_helper.rb +19 -17
- data/lib/action_view/helpers/atom_feed_helper.rb +3 -1
- data/lib/action_view/helpers/cache_helper.rb +24 -14
- data/lib/action_view/helpers/capture_helper.rb +9 -7
- data/lib/action_view/helpers/controller_helper.rb +3 -1
- data/lib/action_view/helpers/csp_helper.rb +24 -0
- data/lib/action_view/helpers/csrf_helper.rb +4 -2
- data/lib/action_view/helpers/date_helper.rb +7 -5
- data/lib/action_view/helpers/debug_helper.rb +4 -2
- data/lib/action_view/helpers/form_helper.rb +53 -70
- data/lib/action_view/helpers/form_options_helper.rb +23 -17
- data/lib/action_view/helpers/form_tag_helper.rb +23 -11
- data/lib/action_view/helpers/javascript_helper.rb +20 -5
- data/lib/action_view/helpers/number_helper.rb +2 -0
- data/lib/action_view/helpers/output_safety_helper.rb +2 -0
- data/lib/action_view/helpers/record_tag_helper.rb +3 -1
- data/lib/action_view/helpers/rendering_helper.rb +3 -1
- data/lib/action_view/helpers/sanitize_helper.rb +3 -1
- data/lib/action_view/helpers/tag_helper.rb +39 -8
- data/lib/action_view/helpers/tags/base.rb +12 -10
- data/lib/action_view/helpers/tags/check_box.rb +3 -1
- data/lib/action_view/helpers/tags/checkable.rb +4 -2
- data/lib/action_view/helpers/tags/collection_check_boxes.rb +2 -0
- data/lib/action_view/helpers/tags/collection_helpers.rb +2 -0
- data/lib/action_view/helpers/tags/collection_radio_buttons.rb +2 -0
- data/lib/action_view/helpers/tags/collection_select.rb +3 -1
- data/lib/action_view/helpers/tags/color_field.rb +3 -1
- data/lib/action_view/helpers/tags/date_field.rb +2 -0
- data/lib/action_view/helpers/tags/date_select.rb +3 -1
- data/lib/action_view/helpers/tags/datetime_field.rb +3 -1
- data/lib/action_view/helpers/tags/datetime_local_field.rb +2 -0
- data/lib/action_view/helpers/tags/datetime_select.rb +2 -0
- data/lib/action_view/helpers/tags/email_field.rb +2 -0
- data/lib/action_view/helpers/tags/file_field.rb +2 -0
- data/lib/action_view/helpers/tags/grouped_collection_select.rb +3 -1
- data/lib/action_view/helpers/tags/hidden_field.rb +2 -0
- data/lib/action_view/helpers/tags/label.rb +2 -4
- data/lib/action_view/helpers/tags/month_field.rb +2 -0
- data/lib/action_view/helpers/tags/number_field.rb +2 -0
- data/lib/action_view/helpers/tags/password_field.rb +2 -0
- data/lib/action_view/helpers/tags/placeholderable.rb +2 -0
- data/lib/action_view/helpers/tags/radio_button.rb +3 -1
- data/lib/action_view/helpers/tags/range_field.rb +2 -0
- data/lib/action_view/helpers/tags/search_field.rb +2 -0
- data/lib/action_view/helpers/tags/select.rb +4 -2
- data/lib/action_view/helpers/tags/tel_field.rb +2 -0
- data/lib/action_view/helpers/tags/text_area.rb +3 -1
- data/lib/action_view/helpers/tags/text_field.rb +3 -1
- data/lib/action_view/helpers/tags/time_field.rb +2 -0
- data/lib/action_view/helpers/tags/time_select.rb +2 -0
- data/lib/action_view/helpers/tags/time_zone_select.rb +3 -1
- data/lib/action_view/helpers/tags/translator.rb +2 -0
- data/lib/action_view/helpers/tags/url_field.rb +2 -0
- data/lib/action_view/helpers/tags/week_field.rb +2 -0
- data/lib/action_view/helpers/tags.rb +3 -1
- data/lib/action_view/helpers/text_helper.rb +9 -7
- data/lib/action_view/helpers/translation_helper.rb +17 -5
- data/lib/action_view/helpers/url_helper.rb +28 -4
- data/lib/action_view/helpers.rb +4 -0
- data/lib/action_view/layouts.rb +7 -5
- data/lib/action_view/log_subscriber.rb +5 -3
- data/lib/action_view/lookup_context.rb +4 -4
- data/lib/action_view/model_naming.rb +2 -0
- data/lib/action_view/path_set.rb +2 -0
- data/lib/action_view/railtie.rb +11 -2
- data/lib/action_view/record_identifier.rb +2 -0
- data/lib/action_view/renderer/abstract_renderer.rb +2 -0
- data/lib/action_view/renderer/partial_renderer/collection_caching.rb +4 -2
- data/lib/action_view/renderer/partial_renderer.rb +13 -11
- data/lib/action_view/renderer/renderer.rb +2 -0
- data/lib/action_view/renderer/streaming_template_renderer.rb +5 -1
- data/lib/action_view/renderer/template_renderer.rb +2 -0
- data/lib/action_view/rendering.rb +3 -5
- data/lib/action_view/routing_url_for.rb +2 -0
- data/lib/action_view/tasks/cache_digests.rake +2 -0
- data/lib/action_view/template/error.rb +2 -3
- data/lib/action_view/template/handlers/builder.rb +3 -4
- data/lib/action_view/template/handlers/erb/erubi.rb +2 -0
- data/lib/action_view/template/handlers/erb.rb +5 -9
- data/lib/action_view/template/handlers/html.rb +2 -0
- data/lib/action_view/template/handlers/raw.rb +2 -0
- data/lib/action_view/template/handlers.rb +3 -1
- data/lib/action_view/template/html.rb +3 -1
- data/lib/action_view/template/resolver.rb +7 -6
- data/lib/action_view/template/text.rb +3 -1
- data/lib/action_view/template/types.rb +3 -1
- data/lib/action_view/template.rb +6 -4
- data/lib/action_view/test_case.rb +21 -5
- data/lib/action_view/testing/resolvers.rb +3 -1
- data/lib/action_view/version.rb +2 -0
- data/lib/action_view/view_paths.rb +3 -3
- data/lib/action_view.rb +4 -3
- data/lib/assets/compiled/rails-ujs.js +52 -15
- metadata +15 -16
- data/lib/action_view/template/handlers/erb/deprecated_erubis.rb +0 -9
- data/lib/action_view/template/handlers/erb/erubis.rb +0 -81
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a732cbd8a2b766ebf37e375ffd2f97c71760de86cb46d9a70702896d07aeb73
|
4
|
+
data.tar.gz: d76fb4ed63f24c3e6b09b576fe3b945b7eb436059cb703e241da7d7d9343cf90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69feb0b2c271b42c17c0bc55d0cee3f857aa4a177fe9e27edaf9a5cc101b2a92b5eb0cb678d89c7ea1f40fa1a1c28a6288c2ee9e5dee16db0859777259fce137
|
7
|
+
data.tar.gz: a04fc509175c93512d6517742c283d617749b1498a422c05a6ab02da17ce0042e33011176c83b97e48638f7e2750921d04fd8855bbfb6fc29a1cb1bbbd63bf8b
|
data/CHANGELOG.md
CHANGED
@@ -1,306 +1,247 @@
|
|
1
|
-
## Rails 5.1
|
1
|
+
## Rails 5.2.8.1 (July 12, 2022) ##
|
2
2
|
|
3
|
-
*
|
3
|
+
* No changes.
|
4
4
|
|
5
|
-
`button_to` was throwing exception when invoked with `params` hash that
|
6
|
-
contains symbol and string keys. The reason for the exception was that
|
7
|
-
`to_form_params` was comparing the given symbol and string keys.
|
8
5
|
|
9
|
-
|
10
|
-
`to_form_params` before comparing them.
|
6
|
+
## Rails 5.2.8 (May 09, 2022) ##
|
11
7
|
|
12
|
-
|
8
|
+
* No changes.
|
13
9
|
|
14
|
-
## Rails 5.1.6.2 (March 11, 2019) ##
|
15
10
|
|
16
|
-
|
11
|
+
## Rails 5.2.7.1 (April 26, 2022) ##
|
17
12
|
|
13
|
+
* Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
|
18
14
|
|
19
|
-
|
15
|
+
Escape dangerous characters in names of tags and names of attributes in the
|
16
|
+
tag helpers, following the XML specification. Rename the option
|
17
|
+
`:escape_attributes` to `:escape`, to simplify by applying the option to the
|
18
|
+
whole tag.
|
20
19
|
|
21
|
-
*
|
20
|
+
*Álvaro Martín Fraguas*
|
22
21
|
|
23
22
|
|
24
|
-
## Rails 5.
|
23
|
+
## Rails 5.2.7 (March 10, 2022) ##
|
25
24
|
|
26
25
|
* No changes.
|
27
26
|
|
28
27
|
|
29
|
-
## Rails 5.
|
28
|
+
## Rails 5.2.6.3 (March 08, 2022) ##
|
30
29
|
|
31
30
|
* No changes.
|
32
31
|
|
33
32
|
|
34
|
-
## Rails 5.
|
33
|
+
## Rails 5.2.6.2 (February 11, 2022) ##
|
35
34
|
|
36
35
|
* No changes.
|
37
36
|
|
38
37
|
|
39
|
-
## Rails 5.
|
38
|
+
## Rails 5.2.6.1 (February 11, 2022) ##
|
40
39
|
|
41
40
|
* No changes.
|
42
41
|
|
43
42
|
|
44
|
-
## Rails 5.
|
43
|
+
## Rails 5.2.6 (May 05, 2021) ##
|
45
44
|
|
46
45
|
* No changes.
|
47
46
|
|
48
47
|
|
49
|
-
## Rails 5.
|
48
|
+
## Rails 5.2.5 (March 26, 2021) ##
|
50
49
|
|
51
50
|
* No changes.
|
52
51
|
|
53
52
|
|
54
|
-
## Rails 5.
|
53
|
+
## Rails 5.2.4.6 (May 05, 2021) ##
|
55
54
|
|
56
55
|
* No changes.
|
57
56
|
|
58
57
|
|
59
|
-
## Rails 5.
|
58
|
+
## Rails 5.2.4.5 (February 10, 2021) ##
|
60
59
|
|
61
60
|
* No changes.
|
62
61
|
|
63
62
|
|
64
|
-
## Rails 5.
|
63
|
+
## Rails 5.2.4.4 (September 09, 2020) ##
|
65
64
|
|
66
|
-
* Fix
|
67
|
-
|
68
|
-
Fixes #29401.
|
69
|
-
|
70
|
-
*Nikita Savrov*
|
71
|
-
|
72
|
-
* Generate field ids in `collection_check_boxes` and `collection_radio_buttons`.
|
65
|
+
* [CVE-2020-15169] Fix potential XSS vulnerability in the `translate`/`t` helper
|
73
66
|
|
74
|
-
|
67
|
+
*Jonathan Hefner*
|
75
68
|
|
76
|
-
Fixes #29014.
|
77
69
|
|
78
|
-
|
70
|
+
## Rails 5.2.4.3 (May 18, 2020) ##
|
79
71
|
|
80
|
-
*
|
81
|
-
for bad input.
|
72
|
+
* [CVE-2020-8167] Check that request is same-origin prior to including CSRF token in XHRs
|
82
73
|
|
83
|
-
*Jay Hayes*
|
84
74
|
|
75
|
+
## Rails 5.2.4.2 (March 19, 2020) ##
|
85
76
|
|
86
|
-
|
77
|
+
* Fix possible XSS vector in `escape_javascript` helper
|
87
78
|
|
88
|
-
|
79
|
+
CVE-2020-5267
|
89
80
|
|
81
|
+
*Aaron Patterson*
|
90
82
|
|
91
|
-
## Rails 5.1.0 (April 27, 2017) ##
|
92
83
|
|
93
|
-
|
84
|
+
## Rails 5.2.4.1 (December 18, 2019) ##
|
94
85
|
|
95
|
-
|
96
|
-
`encode_special_chars` option.
|
86
|
+
* No changes.
|
97
87
|
|
98
|
-
Fixes #28060.
|
99
88
|
|
100
|
-
|
89
|
+
## Rails 5.2.4 (November 27, 2019) ##
|
101
90
|
|
102
|
-
*
|
91
|
+
* Allow programmatic click events to trigger Rails UJS click handlers.
|
92
|
+
Programmatic click events (eg. ones generated by `Rails.fire(link, "click")`) don't specify a button. These events were being incorrectly stopped by code meant to ignore scroll wheel and right clicks introduced in #34573.
|
103
93
|
|
104
|
-
|
105
|
-
Plus it supports `--enable-frozen-string-literal` in Ruby 2.3+.
|
94
|
+
*Sudara Williams*
|
106
95
|
|
107
|
-
Compatibility: Drops support for `<%===` tags for debug output.
|
108
|
-
These were an unused, undocumented side effect of the Erubis
|
109
|
-
implementation.
|
110
96
|
|
111
|
-
|
112
|
-
handful of folks using it directly.
|
97
|
+
## Rails 5.2.3 (March 27, 2019) ##
|
113
98
|
|
114
|
-
|
99
|
+
* Prevent non-primary mouse keys from triggering Rails UJS click handlers.
|
100
|
+
Firefox fires click events even if the click was triggered by non-primary mouse keys such as right- or scroll-wheel-clicks.
|
101
|
+
For example, right-clicking a link such as the one described below (with an underlying ajax request registered on click) should not cause that request to occur.
|
115
102
|
|
116
|
-
|
103
|
+
```
|
104
|
+
<%= link_to 'Remote', remote_path, class: 'remote', remote: true, data: { type: :json } %>
|
105
|
+
```
|
117
106
|
|
118
|
-
Fixes #
|
107
|
+
Fixes #34541
|
119
108
|
|
120
|
-
*
|
109
|
+
*Wolfgang Hobmaier*
|
121
110
|
|
122
|
-
* Add `check_parameters` option to `current_page?` which makes it more strict.
|
123
111
|
|
124
|
-
|
112
|
+
## Rails 5.2.2.1 (March 11, 2019) ##
|
125
113
|
|
126
|
-
*
|
114
|
+
* Only accept formats from registered mime types
|
127
115
|
|
128
|
-
|
116
|
+
A lack of filtering on mime types could allow an attacker to read
|
117
|
+
arbitrary files on the target server or to perform a denial of service
|
118
|
+
attack.
|
129
119
|
|
130
|
-
|
120
|
+
Fixes CVE-2019-5418
|
121
|
+
Fixes CVE-2019-5419
|
131
122
|
|
132
|
-
*
|
133
|
-
to enable template recompilation.
|
123
|
+
*John Hawthorn*, *Eileen M. Uchitelle*, *Aaron Patterson*
|
134
124
|
|
135
|
-
Before it was enabled by `consider_all_requests_local`, which caused
|
136
|
-
recompilation in tests.
|
137
125
|
|
138
|
-
|
126
|
+
## Rails 5.2.2 (December 04, 2018) ##
|
139
127
|
|
140
|
-
*
|
128
|
+
* No changes.
|
141
129
|
|
142
|
-
Used like `form_tag` (where just the open tag is output):
|
143
130
|
|
144
|
-
|
145
|
-
<%= form_with scope: :post, url: super_special_posts_path %>
|
146
|
-
```
|
131
|
+
## Rails 5.2.1.1 (November 27, 2018) ##
|
147
132
|
|
148
|
-
|
133
|
+
* No changes.
|
149
134
|
|
150
|
-
```erb
|
151
|
-
<%= form_with model: @post do |form| %>
|
152
|
-
<%= form.text_field :title %>
|
153
|
-
<% end %>
|
154
|
-
```
|
155
135
|
|
156
|
-
|
136
|
+
## Rails 5.2.1 (August 07, 2018) ##
|
157
137
|
|
158
|
-
*
|
138
|
+
* Fix leak of `skip_default_ids` and `allow_method_names_outside_object` options
|
139
|
+
to HTML attributes.
|
159
140
|
|
160
|
-
|
161
|
-
<%= fields :comment, model: @comment do |fields| %>
|
162
|
-
<%= fields.text_field :title %>
|
163
|
-
<% end %>
|
164
|
-
```
|
141
|
+
*Yurii Cherniavskyi*
|
165
142
|
|
166
|
-
|
143
|
+
* Fix issue with `button_to`'s `to_form_params`
|
167
144
|
|
168
|
-
|
145
|
+
`button_to` was throwing exception when invoked with `params` hash that
|
146
|
+
contains symbol and string keys. The reason for the exception was that
|
147
|
+
`to_form_params` was comparing the given symbol and string keys.
|
169
148
|
|
170
|
-
|
149
|
+
The issue is fixed by turning all keys to strings inside
|
150
|
+
`to_form_params` before comparing them.
|
171
151
|
|
172
|
-
*
|
152
|
+
*Georgi Georgiev*
|
173
153
|
|
174
|
-
*
|
154
|
+
* Fix JavaScript views rendering does not work with Firefox when using
|
155
|
+
Content Security Policy.
|
175
156
|
|
176
|
-
|
177
|
-
will still be available in `local_assigns`.
|
157
|
+
Fixes #32577.
|
178
158
|
|
179
|
-
|
159
|
+
*Yuji Yaginuma*
|
180
160
|
|
181
|
-
|
182
|
-
|
161
|
+
* Add the `nonce: true` option for `javascript_include_tag` helper to
|
162
|
+
support automatic nonce generation for Content Security Policy.
|
163
|
+
Works the same way as `javascript_tag nonce: true` does.
|
183
164
|
|
184
|
-
|
185
|
-
<%= tag.div class: local_assigns[:class] do %>
|
186
|
-
<p><%= message %></p>
|
187
|
-
<% end %>
|
188
|
-
```
|
165
|
+
*Yaroslav Markin*
|
189
166
|
|
190
|
-
*Peter Schilling*, *Matthew Draper*
|
191
167
|
|
192
|
-
|
168
|
+
## Rails 5.2.0 (April 09, 2018) ##
|
193
169
|
|
194
|
-
|
195
|
-
`image_tag` and `audio_tag` now accept a `:skip_pipeline` option which can
|
196
|
-
be set to true to bypass the asset pipeline and serve the assets from the
|
197
|
-
public folder.
|
170
|
+
* Pass the `:skip_pipeline` option in `image_submit_tag` when calling `path_to_image`.
|
198
171
|
|
199
|
-
|
172
|
+
Fixes #32248.
|
200
173
|
|
201
|
-
*
|
174
|
+
*Andrew White*
|
202
175
|
|
203
|
-
|
204
|
-
in combination with the `:poster` option to bypass the asset pipeline and
|
205
|
-
serve the poster image for the video from the public folder.
|
176
|
+
* Allow the use of callable objects as group methods for grouped selects.
|
206
177
|
|
207
|
-
|
178
|
+
Until now, the `option_groups_from_collection_for_select` method was only able to
|
179
|
+
handle method names as `group_method` and `group_label_method` parameters,
|
180
|
+
it is now able to receive procs and other callable objects too.
|
208
181
|
|
209
|
-
*
|
182
|
+
*Jérémie Bonal*
|
210
183
|
|
211
|
-
|
212
|
-
the cache:
|
184
|
+
* Add `preload_link_tag` helper.
|
213
185
|
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
```
|
186
|
+
This helper that allows to the browser to initiate early fetch of resources
|
187
|
+
(different to the specified in `javascript_include_tag` and `stylesheet_link_tag`).
|
188
|
+
Additionally, this sends Early Hints if supported by browser.
|
218
189
|
|
219
|
-
|
190
|
+
*Guillermo Iguaran*
|
220
191
|
|
221
|
-
|
222
|
-
Read fragment views/v1/2914079/v1/2914079/recordings/70182313-20160225015037000000/d0bdf2974e1ef6d31685c3b392ad0b74 (0.6ms)
|
223
|
-
Rendered messages/_message.html.erb in 1.2 ms [cache hit]
|
224
|
-
Write fragment views/v1/2914079/v1/2914079/recordings/70182313-20160225015037000000/3b4e249ac9d168c617e32e84b99218b5 (1.1ms)
|
225
|
-
Rendered recordings/threads/_thread.html.erb in 1.5 ms [cache miss]
|
226
|
-
```
|
192
|
+
* Change `form_with` to generates ids by default.
|
227
193
|
|
228
|
-
|
229
|
-
`
|
194
|
+
When `form_with` was introduced we disabled the automatic generation of ids
|
195
|
+
that was enabled in `form_for`. This usually is not an good idea since labels don't work
|
196
|
+
when the input doesn't have an id and it made harder to test with Capybara.
|
230
197
|
|
231
|
-
|
198
|
+
You can still disable the automatic generation of ids setting `config.action_view.form_with_generates_ids`
|
199
|
+
to `false.`
|
232
200
|
|
233
|
-
*
|
234
|
-
implement `to_a`.
|
201
|
+
*Nick Pezza*
|
235
202
|
|
236
|
-
|
237
|
-
queries of ActiveRecord Relations by calling `#to_ary` on the given
|
238
|
-
collection. Instances of `Enumerator` or `Enumerable` are valid
|
239
|
-
collections, but they do not implement `#to_ary`. By changing this to
|
240
|
-
`#to_a`, they will now be extracted and rendered as expected.
|
203
|
+
* Fix issues with `field_error_proc` wrapping `optgroup` and select divider `option`.
|
241
204
|
|
242
|
-
|
205
|
+
Fixes #31088
|
243
206
|
|
244
|
-
*
|
245
|
-
Example usage of tag helpers before:
|
207
|
+
*Matthias Neumayr*
|
246
208
|
|
247
|
-
|
248
|
-
tag(:br, nil, true)
|
249
|
-
content_tag(:div, content_tag(:p, "Hello world!"), class: "strong")
|
209
|
+
* Remove deprecated Erubis ERB handler.
|
250
210
|
|
251
|
-
|
252
|
-
Hello world!
|
253
|
-
<% end -%>
|
254
|
-
```
|
211
|
+
*Rafael Mendonça França*
|
255
212
|
|
256
|
-
|
213
|
+
* Remove default `alt` text generation.
|
257
214
|
|
258
|
-
|
259
|
-
tag.br
|
260
|
-
tag.div tag.p("Hello world!"), class: "strong"
|
215
|
+
Fixes #30096
|
261
216
|
|
262
|
-
|
263
|
-
Hello world!
|
264
|
-
<% end %>
|
265
|
-
```
|
217
|
+
*Cameron Cundiff*
|
266
218
|
|
267
|
-
|
219
|
+
* Add `srcset` option to `image_tag` helper.
|
268
220
|
|
269
|
-
*
|
221
|
+
*Roberto Miranda*
|
270
222
|
|
271
|
-
|
272
|
-
and it is recommended to use `datetime-local`.
|
273
|
-
Ref: https://html.spec.whatwg.org/multipage/forms.html#local-date-and-time-state-(type=datetime-local)
|
223
|
+
* Fix issues with scopes and engine on `current_page?` method.
|
274
224
|
|
275
|
-
|
225
|
+
Fixes #29401.
|
276
226
|
|
277
|
-
*
|
278
|
-
|
227
|
+
*Nikita Savrov*
|
228
|
+
|
229
|
+
* Generate field ids in `collection_check_boxes` and `collection_radio_buttons`.
|
279
230
|
|
280
|
-
|
281
|
-
the ERB template handler escaped strings by default this broke some applications that
|
282
|
-
expected plain JS or HTML files to be rendered unescaped. This fixes the issue caused
|
283
|
-
by changing the default handler by changing the Raw template handler to output HTML-safe
|
284
|
-
strings.
|
231
|
+
This makes sure that the labels are linked up with the fields.
|
285
232
|
|
286
|
-
|
233
|
+
Fixes #29014.
|
287
234
|
|
288
|
-
*
|
289
|
-
when the value as well as content for option tag are empty, so that we conform with html specification.
|
290
|
-
Ref: https://www.w3.org/TR/html5/forms.html#the-option-element.
|
235
|
+
*Yuji Yaginuma*
|
291
236
|
|
292
|
-
|
237
|
+
* Add `:json` type to `auto_discovery_link_tag` to support [JSON Feeds](https://jsonfeed.org/version/1).
|
293
238
|
|
294
|
-
|
295
|
-
<option value=""></option>
|
296
|
-
```
|
239
|
+
*Mike Gunderloy*
|
297
240
|
|
298
|
-
|
241
|
+
* Update `distance_of_time_in_words` helper to display better error messages
|
242
|
+
for bad input.
|
299
243
|
|
300
|
-
|
301
|
-
<option value="" label=" "></option>
|
302
|
-
```
|
244
|
+
*Jay Hayes*
|
303
245
|
|
304
|
-
*Vipul A M*
|
305
246
|
|
306
|
-
Please check [5-
|
247
|
+
Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/actionview/CHANGELOG.md) for previous changes.
|
data/MIT-LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -11,16 +11,16 @@ The latest version of Action View can be installed with RubyGems:
|
|
11
11
|
|
12
12
|
$ gem install actionview
|
13
13
|
|
14
|
-
Source code can be downloaded as part of the Rails project on GitHub
|
14
|
+
Source code can be downloaded as part of the Rails project on GitHub:
|
15
15
|
|
16
|
-
* https://github.com/rails/rails/tree/
|
16
|
+
* https://github.com/rails/rails/tree/5-2-stable/actionview
|
17
17
|
|
18
18
|
|
19
19
|
== License
|
20
20
|
|
21
21
|
Action View is released under the MIT license:
|
22
22
|
|
23
|
-
*
|
23
|
+
* https://opensource.org/licenses/MIT
|
24
24
|
|
25
25
|
|
26
26
|
== Support
|
@@ -29,7 +29,7 @@ API documentation is at
|
|
29
29
|
|
30
30
|
* http://api.rubyonrails.org
|
31
31
|
|
32
|
-
Bug reports
|
32
|
+
Bug reports for the Ruby on Rails project can be filed here:
|
33
33
|
|
34
34
|
* https://github.com/rails/rails/issues
|
35
35
|
|
data/lib/action_view/base.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "active_support/core_ext/module/attr_internal"
|
2
4
|
require "active_support/core_ext/module/attribute_accessors"
|
3
5
|
require "active_support/ordered_options"
|
@@ -140,30 +142,25 @@ module ActionView #:nodoc:
|
|
140
142
|
include Helpers, ::ERB::Util, Context
|
141
143
|
|
142
144
|
# Specify the proc used to decorate input tags that refer to attributes with errors.
|
143
|
-
cattr_accessor :field_error_proc
|
144
|
-
@@field_error_proc = Proc.new { |html_tag, instance| "<div class=\"field_with_errors\">#{html_tag}</div>".html_safe }
|
145
|
+
cattr_accessor :field_error_proc, default: Proc.new { |html_tag, instance| "<div class=\"field_with_errors\">#{html_tag}</div>".html_safe }
|
145
146
|
|
146
147
|
# How to complete the streaming when an exception occurs.
|
147
148
|
# This is our best guess: first try to close the attribute, then the tag.
|
148
|
-
cattr_accessor :streaming_completion_on_exception
|
149
|
-
@@streaming_completion_on_exception = %("><script>window.location = "/500.html"</script></html>)
|
149
|
+
cattr_accessor :streaming_completion_on_exception, default: %("><script>window.location = "/500.html"</script></html>)
|
150
150
|
|
151
151
|
# Specify whether rendering within namespaced controllers should prefix
|
152
152
|
# the partial paths for ActiveModel objects with the namespace.
|
153
153
|
# (e.g., an Admin::PostsController would render @post using /admin/posts/_post.erb)
|
154
|
-
cattr_accessor :prefix_partial_path_with_controller_namespace
|
155
|
-
@@prefix_partial_path_with_controller_namespace = true
|
154
|
+
cattr_accessor :prefix_partial_path_with_controller_namespace, default: true
|
156
155
|
|
157
156
|
# Specify default_formats that can be rendered.
|
158
157
|
cattr_accessor :default_formats
|
159
158
|
|
160
159
|
# Specify whether an error should be raised for missing translations
|
161
|
-
cattr_accessor :raise_on_missing_translations
|
162
|
-
@@raise_on_missing_translations = false
|
160
|
+
cattr_accessor :raise_on_missing_translations, default: false
|
163
161
|
|
164
162
|
# Specify whether submit_tag should automatically disable on click
|
165
|
-
cattr_accessor :automatically_disable_submit_tag
|
166
|
-
@@automatically_disable_submit_tag = true
|
163
|
+
cattr_accessor :automatically_disable_submit_tag, default: true
|
167
164
|
|
168
165
|
class_attribute :_routes
|
169
166
|
class_attribute :logger
|
@@ -207,6 +204,7 @@ module ActionView #:nodoc:
|
|
207
204
|
@view_renderer = ActionView::Renderer.new(lookup_context)
|
208
205
|
end
|
209
206
|
|
207
|
+
@cache_hit = {}
|
210
208
|
assign(assigns)
|
211
209
|
assign_controller(controller)
|
212
210
|
_prepare_context
|
data/lib/action_view/buffers.rb
CHANGED
data/lib/action_view/context.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ActionView
|
2
4
|
module CompiledTemplates #:nodoc:
|
3
5
|
# holds compiled template code
|
@@ -17,7 +19,6 @@ module ActionView
|
|
17
19
|
attr_accessor :output_buffer, :view_flow
|
18
20
|
|
19
21
|
# Prepares the context by setting the appropriate instance variables.
|
20
|
-
# :api: plugin
|
21
22
|
def _prepare_context
|
22
23
|
@view_flow = OutputFlow.new
|
23
24
|
@output_buffer = nil
|
@@ -27,7 +28,6 @@ module ActionView
|
|
27
28
|
# Encapsulates the interaction with the view flow so it
|
28
29
|
# returns the correct buffer on +yield+. This is usually
|
29
30
|
# overwritten by helpers to add more behavior.
|
30
|
-
# :api: plugin
|
31
31
|
def _layout_for(name = nil)
|
32
32
|
name ||= :layout
|
33
33
|
view_flow.get(name).html_safe
|
data/lib/action_view/digestor.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "concurrent/map"
|
2
4
|
require "action_view/dependency_tracker"
|
3
5
|
require "monitor"
|
@@ -68,13 +70,11 @@ module ActionView
|
|
68
70
|
end
|
69
71
|
|
70
72
|
private
|
71
|
-
def find_template(finder,
|
73
|
+
def find_template(finder, name, prefixes, partial, keys)
|
72
74
|
finder.disable_cache do
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
finder.find_all(*args).first
|
77
|
-
end
|
75
|
+
format = finder.rendered_format
|
76
|
+
result = finder.find_all(name, prefixes, partial, keys, formats: [format]).first if format
|
77
|
+
result || finder.find_all(name, prefixes, partial, keys).first
|
78
78
|
end
|
79
79
|
end
|
80
80
|
end
|
@@ -95,7 +95,7 @@ module ActionView
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def digest(finder, stack = [])
|
98
|
-
Digest
|
98
|
+
ActiveSupport::Digest.hexdigest("#{template.source}-#{dependency_digest(finder, stack)}")
|
99
99
|
end
|
100
100
|
|
101
101
|
def dependency_digest(finder, stack)
|
data/lib/action_view/flows.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ActionView
|
2
4
|
# Returns the version of the currently loaded Action View as a <tt>Gem::Version</tt>
|
3
5
|
def self.gem_version
|
@@ -6,9 +8,9 @@ module ActionView
|
|
6
8
|
|
7
9
|
module VERSION
|
8
10
|
MAJOR = 5
|
9
|
-
MINOR =
|
10
|
-
TINY =
|
11
|
-
PRE =
|
11
|
+
MINOR = 2
|
12
|
+
TINY = 8
|
13
|
+
PRE = "1"
|
12
14
|
|
13
15
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
14
16
|
end
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "active_support/core_ext/module/attribute_accessors"
|
2
4
|
require "active_support/core_ext/enumerable"
|
3
5
|
|
4
6
|
module ActionView
|
5
7
|
# = Active Model Helpers
|
6
|
-
module Helpers
|
8
|
+
module Helpers #:nodoc:
|
7
9
|
module ActiveModelHelper
|
8
10
|
end
|
9
11
|
|
@@ -15,8 +17,8 @@ module ActionView
|
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
18
|
-
def content_tag(*)
|
19
|
-
error_wrapping(super)
|
20
|
+
def content_tag(type, options, *)
|
21
|
+
select_markup_helper?(type) ? super : error_wrapping(super)
|
20
22
|
end
|
21
23
|
|
22
24
|
def tag(type, options, *)
|
@@ -41,6 +43,10 @@ module ActionView
|
|
41
43
|
object.respond_to?(:errors) && object.errors.respond_to?(:[]) && error_message.present?
|
42
44
|
end
|
43
45
|
|
46
|
+
def select_markup_helper?(type)
|
47
|
+
["optgroup", "option"].include?(type)
|
48
|
+
end
|
49
|
+
|
44
50
|
def tag_generate_errors?(options)
|
45
51
|
options["type"] != "hidden"
|
46
52
|
end
|