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.

Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +119 -178
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +4 -4
  5. data/lib/action_view/base.rb +8 -10
  6. data/lib/action_view/buffers.rb +2 -0
  7. data/lib/action_view/context.rb +2 -2
  8. data/lib/action_view/dependency_tracker.rb +2 -0
  9. data/lib/action_view/digestor.rb +7 -7
  10. data/lib/action_view/flows.rb +2 -0
  11. data/lib/action_view/gem_version.rb +5 -3
  12. data/lib/action_view/helpers/active_model_helper.rb +9 -3
  13. data/lib/action_view/helpers/asset_tag_helper.rb +180 -34
  14. data/lib/action_view/helpers/asset_url_helper.rb +19 -17
  15. data/lib/action_view/helpers/atom_feed_helper.rb +3 -1
  16. data/lib/action_view/helpers/cache_helper.rb +24 -14
  17. data/lib/action_view/helpers/capture_helper.rb +9 -7
  18. data/lib/action_view/helpers/controller_helper.rb +3 -1
  19. data/lib/action_view/helpers/csp_helper.rb +24 -0
  20. data/lib/action_view/helpers/csrf_helper.rb +4 -2
  21. data/lib/action_view/helpers/date_helper.rb +7 -5
  22. data/lib/action_view/helpers/debug_helper.rb +4 -2
  23. data/lib/action_view/helpers/form_helper.rb +53 -70
  24. data/lib/action_view/helpers/form_options_helper.rb +23 -17
  25. data/lib/action_view/helpers/form_tag_helper.rb +23 -11
  26. data/lib/action_view/helpers/javascript_helper.rb +20 -5
  27. data/lib/action_view/helpers/number_helper.rb +2 -0
  28. data/lib/action_view/helpers/output_safety_helper.rb +2 -0
  29. data/lib/action_view/helpers/record_tag_helper.rb +3 -1
  30. data/lib/action_view/helpers/rendering_helper.rb +3 -1
  31. data/lib/action_view/helpers/sanitize_helper.rb +3 -1
  32. data/lib/action_view/helpers/tag_helper.rb +39 -8
  33. data/lib/action_view/helpers/tags/base.rb +12 -10
  34. data/lib/action_view/helpers/tags/check_box.rb +3 -1
  35. data/lib/action_view/helpers/tags/checkable.rb +4 -2
  36. data/lib/action_view/helpers/tags/collection_check_boxes.rb +2 -0
  37. data/lib/action_view/helpers/tags/collection_helpers.rb +2 -0
  38. data/lib/action_view/helpers/tags/collection_radio_buttons.rb +2 -0
  39. data/lib/action_view/helpers/tags/collection_select.rb +3 -1
  40. data/lib/action_view/helpers/tags/color_field.rb +3 -1
  41. data/lib/action_view/helpers/tags/date_field.rb +2 -0
  42. data/lib/action_view/helpers/tags/date_select.rb +3 -1
  43. data/lib/action_view/helpers/tags/datetime_field.rb +3 -1
  44. data/lib/action_view/helpers/tags/datetime_local_field.rb +2 -0
  45. data/lib/action_view/helpers/tags/datetime_select.rb +2 -0
  46. data/lib/action_view/helpers/tags/email_field.rb +2 -0
  47. data/lib/action_view/helpers/tags/file_field.rb +2 -0
  48. data/lib/action_view/helpers/tags/grouped_collection_select.rb +3 -1
  49. data/lib/action_view/helpers/tags/hidden_field.rb +2 -0
  50. data/lib/action_view/helpers/tags/label.rb +2 -4
  51. data/lib/action_view/helpers/tags/month_field.rb +2 -0
  52. data/lib/action_view/helpers/tags/number_field.rb +2 -0
  53. data/lib/action_view/helpers/tags/password_field.rb +2 -0
  54. data/lib/action_view/helpers/tags/placeholderable.rb +2 -0
  55. data/lib/action_view/helpers/tags/radio_button.rb +3 -1
  56. data/lib/action_view/helpers/tags/range_field.rb +2 -0
  57. data/lib/action_view/helpers/tags/search_field.rb +2 -0
  58. data/lib/action_view/helpers/tags/select.rb +4 -2
  59. data/lib/action_view/helpers/tags/tel_field.rb +2 -0
  60. data/lib/action_view/helpers/tags/text_area.rb +3 -1
  61. data/lib/action_view/helpers/tags/text_field.rb +3 -1
  62. data/lib/action_view/helpers/tags/time_field.rb +2 -0
  63. data/lib/action_view/helpers/tags/time_select.rb +2 -0
  64. data/lib/action_view/helpers/tags/time_zone_select.rb +3 -1
  65. data/lib/action_view/helpers/tags/translator.rb +2 -0
  66. data/lib/action_view/helpers/tags/url_field.rb +2 -0
  67. data/lib/action_view/helpers/tags/week_field.rb +2 -0
  68. data/lib/action_view/helpers/tags.rb +3 -1
  69. data/lib/action_view/helpers/text_helper.rb +9 -7
  70. data/lib/action_view/helpers/translation_helper.rb +17 -5
  71. data/lib/action_view/helpers/url_helper.rb +28 -4
  72. data/lib/action_view/helpers.rb +4 -0
  73. data/lib/action_view/layouts.rb +7 -5
  74. data/lib/action_view/log_subscriber.rb +5 -3
  75. data/lib/action_view/lookup_context.rb +4 -4
  76. data/lib/action_view/model_naming.rb +2 -0
  77. data/lib/action_view/path_set.rb +2 -0
  78. data/lib/action_view/railtie.rb +11 -2
  79. data/lib/action_view/record_identifier.rb +2 -0
  80. data/lib/action_view/renderer/abstract_renderer.rb +2 -0
  81. data/lib/action_view/renderer/partial_renderer/collection_caching.rb +4 -2
  82. data/lib/action_view/renderer/partial_renderer.rb +13 -11
  83. data/lib/action_view/renderer/renderer.rb +2 -0
  84. data/lib/action_view/renderer/streaming_template_renderer.rb +5 -1
  85. data/lib/action_view/renderer/template_renderer.rb +2 -0
  86. data/lib/action_view/rendering.rb +3 -5
  87. data/lib/action_view/routing_url_for.rb +2 -0
  88. data/lib/action_view/tasks/cache_digests.rake +2 -0
  89. data/lib/action_view/template/error.rb +2 -3
  90. data/lib/action_view/template/handlers/builder.rb +3 -4
  91. data/lib/action_view/template/handlers/erb/erubi.rb +2 -0
  92. data/lib/action_view/template/handlers/erb.rb +5 -9
  93. data/lib/action_view/template/handlers/html.rb +2 -0
  94. data/lib/action_view/template/handlers/raw.rb +2 -0
  95. data/lib/action_view/template/handlers.rb +3 -1
  96. data/lib/action_view/template/html.rb +3 -1
  97. data/lib/action_view/template/resolver.rb +7 -6
  98. data/lib/action_view/template/text.rb +3 -1
  99. data/lib/action_view/template/types.rb +3 -1
  100. data/lib/action_view/template.rb +6 -4
  101. data/lib/action_view/test_case.rb +21 -5
  102. data/lib/action_view/testing/resolvers.rb +3 -1
  103. data/lib/action_view/version.rb +2 -0
  104. data/lib/action_view/view_paths.rb +3 -3
  105. data/lib/action_view.rb +4 -3
  106. data/lib/assets/compiled/rails-ujs.js +52 -15
  107. metadata +15 -16
  108. data/lib/action_view/template/handlers/erb/deprecated_erubis.rb +0 -9
  109. 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: 653bc5c6f534a3b66e9bc0517e1dae96591c0afc046eb4af21c2bfde0aa5436d
4
- data.tar.gz: 3f6ac20820ff6a4d61dcf499bff23acf931f3a6ea65822720f63e0e522f1b77d
3
+ metadata.gz: 4a732cbd8a2b766ebf37e375ffd2f97c71760de86cb46d9a70702896d07aeb73
4
+ data.tar.gz: d76fb4ed63f24c3e6b09b576fe3b945b7eb436059cb703e241da7d7d9343cf90
5
5
  SHA512:
6
- metadata.gz: c21cc5b6ec4a492a753325d9c732c9c8900ef7e07134bc259becbd040df51afd0ff3bb27141bcd9ac87c02537eae789161e7e5241f4bfadd230a29aabc3a36fa
7
- data.tar.gz: dcd3864b5a9216b19021272876564be5170b6d3e6af094a0a744517d01d89c58629156e6b4a87ebf593e37ae2478eb6687e9e923fe675d22d740e555ea91e64e
6
+ metadata.gz: 69feb0b2c271b42c17c0bc55d0cee3f857aa4a177fe9e27edaf9a5cc101b2a92b5eb0cb678d89c7ea1f40fa1a1c28a6288c2ee9e5dee16db0859777259fce137
7
+ data.tar.gz: a04fc509175c93512d6517742c283d617749b1498a422c05a6ab02da17ce0042e33011176c83b97e48638f7e2750921d04fd8855bbfb6fc29a1cb1bbbd63bf8b
data/CHANGELOG.md CHANGED
@@ -1,306 +1,247 @@
1
- ## Rails 5.1.7 (March 27, 2019) ##
1
+ ## Rails 5.2.8.1 (July 12, 2022) ##
2
2
 
3
- * Fix issue with `button_to`'s `to_form_params`
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
- The issue is fixed by turning all keys to strings inside
10
- `to_form_params` before comparing them.
6
+ ## Rails 5.2.8 (May 09, 2022) ##
11
7
 
12
- *Georgi Georgiev*
8
+ * No changes.
13
9
 
14
- ## Rails 5.1.6.2 (March 11, 2019) ##
15
10
 
16
- * No changes.
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
- ## Rails 5.1.6.1 (November 27, 2018) ##
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
- * No changes.
20
+ *Álvaro Martín Fraguas*
22
21
 
23
22
 
24
- ## Rails 5.1.6 (March 29, 2018) ##
23
+ ## Rails 5.2.7 (March 10, 2022) ##
25
24
 
26
25
  * No changes.
27
26
 
28
27
 
29
- ## Rails 5.1.5 (February 14, 2018) ##
28
+ ## Rails 5.2.6.3 (March 08, 2022) ##
30
29
 
31
30
  * No changes.
32
31
 
33
32
 
34
- ## Rails 5.1.4 (September 07, 2017) ##
33
+ ## Rails 5.2.6.2 (February 11, 2022) ##
35
34
 
36
35
  * No changes.
37
36
 
38
37
 
39
- ## Rails 5.1.4.rc1 (August 24, 2017) ##
38
+ ## Rails 5.2.6.1 (February 11, 2022) ##
40
39
 
41
40
  * No changes.
42
41
 
43
42
 
44
- ## Rails 5.1.3 (August 03, 2017) ##
43
+ ## Rails 5.2.6 (May 05, 2021) ##
45
44
 
46
45
  * No changes.
47
46
 
48
47
 
49
- ## Rails 5.1.3.rc3 (July 31, 2017) ##
48
+ ## Rails 5.2.5 (March 26, 2021) ##
50
49
 
51
50
  * No changes.
52
51
 
53
52
 
54
- ## Rails 5.1.3.rc2 (July 25, 2017) ##
53
+ ## Rails 5.2.4.6 (May 05, 2021) ##
55
54
 
56
55
  * No changes.
57
56
 
58
57
 
59
- ## Rails 5.1.3.rc1 (July 19, 2017) ##
58
+ ## Rails 5.2.4.5 (February 10, 2021) ##
60
59
 
61
60
  * No changes.
62
61
 
63
62
 
64
- ## Rails 5.1.2 (June 26, 2017) ##
63
+ ## Rails 5.2.4.4 (September 09, 2020) ##
65
64
 
66
- * Fix issues with scopes and engine on `current_page?` method.
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
- This makes sure that the labels are linked up with the fields.
67
+ *Jonathan Hefner*
75
68
 
76
- Fixes #29014.
77
69
 
78
- *Yuji Yaginuma*
70
+ ## Rails 5.2.4.3 (May 18, 2020) ##
79
71
 
80
- * Update distance_of_time_in_words helper to display better error messages
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
- ## Rails 5.1.1 (May 12, 2017) ##
77
+ * Fix possible XSS vector in `escape_javascript` helper
87
78
 
88
- * No changes.
79
+ CVE-2020-5267
89
80
 
81
+ *Aaron Patterson*
90
82
 
91
- ## Rails 5.1.0 (April 27, 2017) ##
92
83
 
93
- * Remove the option `encode_special_chars` misnomer from `strip_tags`
84
+ ## Rails 5.2.4.1 (December 18, 2019) ##
94
85
 
95
- As of rails-html-sanitizer v1.0.3, the sanitizer will ignore the
96
- `encode_special_chars` option.
86
+ * No changes.
97
87
 
98
- Fixes #28060.
99
88
 
100
- *Andrew Hood*
89
+ ## Rails 5.2.4 (November 27, 2019) ##
101
90
 
102
- * Change the ERB handler from Erubis to Erubi.
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
- Erubi is an Erubis fork that's svelte, simple, and currently maintained.
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
- Deprecation: The Erubis handler will be removed in Rails 5.2, for the
112
- handful of folks using it directly.
97
+ ## Rails 5.2.3 (March 27, 2019) ##
113
98
 
114
- *Jeremy Evans*
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
- * Allow render locals to be assigned to instance variables in a view.
103
+ ```
104
+ <%= link_to 'Remote', remote_path, class: 'remote', remote: true, data: { type: :json } %>
105
+ ```
117
106
 
118
- Fixes #27480.
107
+ Fixes #34541
119
108
 
120
- *Andrew White*
109
+ *Wolfgang Hobmaier*
121
110
 
122
- * Add `check_parameters` option to `current_page?` which makes it more strict.
123
111
 
124
- *Maksym Pugach*
112
+ ## Rails 5.2.2.1 (March 11, 2019) ##
125
113
 
126
- * Return correct object name in form helper method after `fields_for`.
114
+ * Only accept formats from registered mime types
127
115
 
128
- Fixes #26931.
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
- *Yuji Yaginuma*
120
+ Fixes CVE-2019-5418
121
+ Fixes CVE-2019-5419
131
122
 
132
- * Use `ActionView::Resolver.caching?` (`config.action_view.cache_template_loading`)
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
- *Max Melentiev*
126
+ ## Rails 5.2.2 (December 04, 2018) ##
139
127
 
140
- * Add `form_with` to unify `form_tag` and `form_for` usage.
128
+ * No changes.
141
129
 
142
- Used like `form_tag` (where just the open tag is output):
143
130
 
144
- ```erb
145
- <%= form_with scope: :post, url: super_special_posts_path %>
146
- ```
131
+ ## Rails 5.2.1.1 (November 27, 2018) ##
147
132
 
148
- Used like `form_for`:
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
- *Kasper Timm Hansen*, *Marek Kirejczyk*
136
+ ## Rails 5.2.1 (August 07, 2018) ##
157
137
 
158
- * Add `fields` form helper method.
138
+ * Fix leak of `skip_default_ids` and `allow_method_names_outside_object` options
139
+ to HTML attributes.
159
140
 
160
- ```erb
161
- <%= fields :comment, model: @comment do |fields| %>
162
- <%= fields.text_field :title %>
163
- <% end %>
164
- ```
141
+ *Yurii Cherniavskyi*
165
142
 
166
- Can also be used within form helpers such as `form_with`.
143
+ * Fix issue with `button_to`'s `to_form_params`
167
144
 
168
- *Kasper Timm Hansen*
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
- * Removed deprecated `#original_exception` in `ActionView::Template::Error`.
149
+ The issue is fixed by turning all keys to strings inside
150
+ `to_form_params` before comparing them.
171
151
 
172
- *Rafael Mendonça França*
152
+ *Georgi Georgiev*
173
153
 
174
- * Render now accepts any keys for locals, including reserved keywords.
154
+ * Fix JavaScript views rendering does not work with Firefox when using
155
+ Content Security Policy.
175
156
 
176
- Only locals with valid variable names get set directly. Others
177
- will still be available in `local_assigns`.
157
+ Fixes #32577.
178
158
 
179
- Example of render with reserved keywords:
159
+ *Yuji Yaginuma*
180
160
 
181
- ```erb
182
- <%= render "example", class: "text-center", message: "Hello world!" %>
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
- <!-- _example.html.erb: -->
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
- * Add `:skip_pipeline` option to several asset tag helpers
168
+ ## Rails 5.2.0 (April 09, 2018) ##
193
169
 
194
- `javascript_include_tag`, `stylesheet_link_tag`, `favicon_link_tag`,
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
- *Richard Schneeman*
172
+ Fixes #32248.
200
173
 
201
- * Add `:poster_skip_pipeline` option to the `video_tag` helper
174
+ *Andrew White*
202
175
 
203
- `video_tag` now accepts a `:poster_skip_pipeline` option which can be used
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
- *Richard Schneeman*
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
- * Show cache hits and misses when rendering partials.
182
+ *Jérémie Bonal*
210
183
 
211
- Partials using the `cache` helper will show whether a render hit or missed
212
- the cache:
184
+ * Add `preload_link_tag` helper.
213
185
 
214
- ```
215
- Rendered messages/_message.html.erb in 1.2 ms [cache hit]
216
- Rendered recordings/threads/_thread.html.erb in 1.5 ms [cache miss]
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
- This removes the need for the old fragment cache logging:
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
- Though that full output can be reenabled with
229
- `config.action_controller.enable_fragment_cache_logging = true`.
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
- *Stan Lo*
198
+ You can still disable the automatic generation of ids setting `config.action_view.form_with_generates_ids`
199
+ to `false.`
232
200
 
233
- * Changed partial rendering with a collection to allow collections which
234
- implement `to_a`.
201
+ *Nick Pezza*
235
202
 
236
- Extracting the collection option had an optimization to avoid unnecessary
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
- *Steven Harman*
205
+ Fixes #31088
243
206
 
244
- * New syntax for tag helpers. Avoid positional parameters and support HTML5 by default.
245
- Example usage of tag helpers before:
207
+ *Matthias Neumayr*
246
208
 
247
- ```ruby
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
- <%= content_tag :div, class: "strong" do -%>
252
- Hello world!
253
- <% end -%>
254
- ```
211
+ *Rafael Mendonça França*
255
212
 
256
- Example usage of tag helpers after:
213
+ * Remove default `alt` text generation.
257
214
 
258
- ```ruby
259
- tag.br
260
- tag.div tag.p("Hello world!"), class: "strong"
215
+ Fixes #30096
261
216
 
262
- <%= tag.div class: "strong" do %>
263
- Hello world!
264
- <% end %>
265
- ```
217
+ *Cameron Cundiff*
266
218
 
267
- *Marek Kirejczyk*, *Kasper Timm Hansen*
219
+ * Add `srcset` option to `image_tag` helper.
268
220
 
269
- * Change `datetime_field` and `datetime_field_tag` to generate `datetime-local` fields.
221
+ *Roberto Miranda*
270
222
 
271
- As a new specification of the HTML 5 the text field type `datetime` will no longer exist
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
- *Herminio Torres*
225
+ Fixes #29401.
276
226
 
277
- * Raw template handler (which is also the default template handler in Rails 5) now outputs
278
- HTML-safe strings.
227
+ *Nikita Savrov*
228
+
229
+ * Generate field ids in `collection_check_boxes` and `collection_radio_buttons`.
279
230
 
280
- In Rails 5 the default template handler was changed to the raw template handler. Because
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
- *Eileen M. Uchitelle*
233
+ Fixes #29014.
287
234
 
288
- * `select_tag`'s `include_blank` option for generation for blank option tag, now adds an empty space label,
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
- Generation of option before:
237
+ * Add `:json` type to `auto_discovery_link_tag` to support [JSON Feeds](https://jsonfeed.org/version/1).
293
238
 
294
- ```html
295
- <option value=""></option>
296
- ```
239
+ *Mike Gunderloy*
297
240
 
298
- Generation of option after:
241
+ * Update `distance_of_time_in_words` helper to display better error messages
242
+ for bad input.
299
243
 
300
- ```html
301
- <option value="" label=" "></option>
302
- ```
244
+ *Jay Hayes*
303
245
 
304
- *Vipul A M*
305
246
 
306
- Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/actionview/CHANGELOG.md) for previous changes.
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
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2017 David Heinemeier Hansson
1
+ Copyright (c) 2004-2018 David Heinemeier Hansson
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
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/master/actionview
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
- * http://www.opensource.org/licenses/MIT
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 can be filed for the Ruby on Rails project here:
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
 
@@ -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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "active_support/core_ext/string/output_safety"
2
4
 
3
5
  module ActionView
@@ -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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "concurrent/map"
2
4
  require "action_view/path_set"
3
5
 
@@ -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, *args)
73
+ def find_template(finder, name, prefixes, partial, keys)
72
74
  finder.disable_cache do
73
- if format = finder.rendered_format
74
- finder.find_all(*args, formats: [format]).first || finder.find_all(*args).first
75
- else
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::MD5.hexdigest("#{template.source}-#{dependency_digest(finder, stack)}")
98
+ ActiveSupport::Digest.hexdigest("#{template.source}-#{dependency_digest(finder, stack)}")
99
99
  end
100
100
 
101
101
  def dependency_digest(finder, stack)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "active_support/core_ext/string/output_safety"
2
4
 
3
5
  module ActionView
@@ -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 = 1
10
- TINY = 7
11
- PRE = nil
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