actionview 4.2.11.1 → 6.0.3.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 (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +187 -221
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +9 -8
  5. data/lib/action_view/base.rb +144 -37
  6. data/lib/action_view/buffers.rb +18 -1
  7. data/lib/action_view/cache_expiry.rb +53 -0
  8. data/lib/action_view/context.rb +8 -12
  9. data/lib/action_view/dependency_tracker.rb +54 -20
  10. data/lib/action_view/digestor.rb +88 -85
  11. data/lib/action_view/flows.rb +11 -12
  12. data/lib/action_view/gem_version.rb +5 -3
  13. data/lib/action_view/helpers/active_model_helper.rb +16 -11
  14. data/lib/action_view/helpers/asset_tag_helper.rb +241 -82
  15. data/lib/action_view/helpers/asset_url_helper.rb +171 -67
  16. data/lib/action_view/helpers/atom_feed_helper.rb +19 -17
  17. data/lib/action_view/helpers/cache_helper.rb +112 -42
  18. data/lib/action_view/helpers/capture_helper.rb +20 -13
  19. data/lib/action_view/helpers/controller_helper.rb +15 -4
  20. data/lib/action_view/helpers/csp_helper.rb +26 -0
  21. data/lib/action_view/helpers/csrf_helper.rb +8 -6
  22. data/lib/action_view/helpers/date_helper.rb +230 -129
  23. data/lib/action_view/helpers/debug_helper.rb +7 -6
  24. data/lib/action_view/helpers/form_helper.rb +755 -129
  25. data/lib/action_view/helpers/form_options_helper.rb +130 -75
  26. data/lib/action_view/helpers/form_tag_helper.rb +117 -71
  27. data/lib/action_view/helpers/javascript_helper.rb +30 -14
  28. data/lib/action_view/helpers/number_helper.rb +84 -59
  29. data/lib/action_view/helpers/output_safety_helper.rb +36 -4
  30. data/lib/action_view/helpers/rendering_helper.rb +11 -8
  31. data/lib/action_view/helpers/sanitize_helper.rb +30 -31
  32. data/lib/action_view/helpers/tag_helper.rb +201 -75
  33. data/lib/action_view/helpers/tags/base.rb +138 -98
  34. data/lib/action_view/helpers/tags/check_box.rb +20 -19
  35. data/lib/action_view/helpers/tags/checkable.rb +4 -2
  36. data/lib/action_view/helpers/tags/collection_check_boxes.rb +12 -34
  37. data/lib/action_view/helpers/tags/collection_helpers.rb +69 -36
  38. data/lib/action_view/helpers/tags/collection_radio_buttons.rb +6 -12
  39. data/lib/action_view/helpers/tags/collection_select.rb +4 -2
  40. data/lib/action_view/helpers/tags/color_field.rb +4 -3
  41. data/lib/action_view/helpers/tags/date_field.rb +2 -1
  42. data/lib/action_view/helpers/tags/date_select.rb +37 -36
  43. data/lib/action_view/helpers/tags/datetime_field.rb +4 -3
  44. data/lib/action_view/helpers/tags/datetime_local_field.rb +2 -1
  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 +4 -2
  49. data/lib/action_view/helpers/tags/hidden_field.rb +2 -0
  50. data/lib/action_view/helpers/tags/label.rb +3 -2
  51. data/lib/action_view/helpers/tags/month_field.rb +2 -1
  52. data/lib/action_view/helpers/tags/number_field.rb +2 -0
  53. data/lib/action_view/helpers/tags/password_field.rb +3 -1
  54. data/lib/action_view/helpers/tags/placeholderable.rb +3 -1
  55. data/lib/action_view/helpers/tags/radio_button.rb +7 -6
  56. data/lib/action_view/helpers/tags/range_field.rb +2 -0
  57. data/lib/action_view/helpers/tags/search_field.rb +14 -9
  58. data/lib/action_view/helpers/tags/select.rb +11 -10
  59. data/lib/action_view/helpers/tags/tel_field.rb +2 -0
  60. data/lib/action_view/helpers/tags/text_area.rb +4 -2
  61. data/lib/action_view/helpers/tags/text_field.rb +8 -8
  62. data/lib/action_view/helpers/tags/time_field.rb +2 -1
  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 +15 -16
  66. data/lib/action_view/helpers/tags/url_field.rb +2 -0
  67. data/lib/action_view/helpers/tags/week_field.rb +2 -1
  68. data/lib/action_view/helpers/tags.rb +3 -1
  69. data/lib/action_view/helpers/text_helper.rb +56 -38
  70. data/lib/action_view/helpers/translation_helper.rb +82 -48
  71. data/lib/action_view/helpers/url_helper.rb +160 -105
  72. data/lib/action_view/helpers.rb +5 -3
  73. data/lib/action_view/layouts.rb +65 -61
  74. data/lib/action_view/log_subscriber.rb +61 -10
  75. data/lib/action_view/lookup_context.rb +147 -89
  76. data/lib/action_view/model_naming.rb +3 -1
  77. data/lib/action_view/path_set.rb +28 -23
  78. data/lib/action_view/railtie.rb +62 -6
  79. data/lib/action_view/record_identifier.rb +53 -26
  80. data/lib/action_view/renderer/abstract_renderer.rb +71 -13
  81. data/lib/action_view/renderer/partial_renderer/collection_caching.rb +103 -0
  82. data/lib/action_view/renderer/partial_renderer.rb +239 -225
  83. data/lib/action_view/renderer/renderer.rb +22 -8
  84. data/lib/action_view/renderer/streaming_template_renderer.rb +54 -54
  85. data/lib/action_view/renderer/template_renderer.rb +79 -73
  86. data/lib/action_view/rendering.rb +68 -44
  87. data/lib/action_view/routing_url_for.rb +33 -22
  88. data/lib/action_view/tasks/cache_digests.rake +25 -0
  89. data/lib/action_view/template/error.rb +44 -29
  90. data/lib/action_view/template/handlers/builder.rb +12 -13
  91. data/lib/action_view/template/handlers/erb/erubi.rb +87 -0
  92. data/lib/action_view/template/handlers/erb.rb +24 -86
  93. data/lib/action_view/template/handlers/html.rb +11 -0
  94. data/lib/action_view/template/handlers/raw.rb +4 -4
  95. data/lib/action_view/template/handlers.rb +38 -8
  96. data/lib/action_view/template/html.rb +19 -10
  97. data/lib/action_view/template/inline.rb +22 -0
  98. data/lib/action_view/template/raw_file.rb +28 -0
  99. data/lib/action_view/template/resolver.rb +217 -193
  100. data/lib/action_view/template/sources/file.rb +17 -0
  101. data/lib/action_view/template/sources.rb +13 -0
  102. data/lib/action_view/template/text.rb +11 -10
  103. data/lib/action_view/template/types.rb +18 -18
  104. data/lib/action_view/template.rb +146 -90
  105. data/lib/action_view/test_case.rb +52 -32
  106. data/lib/action_view/testing/resolvers.rb +46 -34
  107. data/lib/action_view/unbound_template.rb +31 -0
  108. data/lib/action_view/version.rb +3 -1
  109. data/lib/action_view/view_paths.rb +48 -31
  110. data/lib/action_view.rb +11 -8
  111. data/lib/assets/compiled/rails-ujs.js +746 -0
  112. metadata +38 -29
  113. data/lib/action_view/helpers/record_tag_helper.rb +0 -108
  114. data/lib/action_view/tasks/dependencies.rake +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71fb7b73001ccc9220ba0da089fc3336a3a18620ca13a18730fa91d4799fbf58
4
- data.tar.gz: a87ef6a72900a81c7cff2d00f3fac65006c0f95935b7bf366c1f4bfa1210b6d1
3
+ metadata.gz: 4d9847672c3b4327d0549b658ed0d559c40b897ac1cf19ec15485871239e83cf
4
+ data.tar.gz: c90e173c0b414a63fb814b34a9d08879a42493d66e2fa42083efa8e883d06802
5
5
  SHA512:
6
- metadata.gz: ea93cb6a5de3af579900cf1534b50842c6d197062ee7a01a9f499287dbbb8f6f3d9c32abfadba3c2d1868b8deddc70594c3e5767744031e47961d5da15cb5e54
7
- data.tar.gz: e59b44cf756ed5bf55ef96709055a04413dfba03fa083c32ef709eb266267ac774bc7d83c08c696a16c98e5dd93a412a531372eee7546bcc8e856e1304dcf618
6
+ metadata.gz: a9060b8101caebedc4f0d93b3f8490fd622a6d8fc5993be0680cabf710fde6f94d0a35964a338f6ecec2b26b9747a840d42ec3e931b26e687f52fda175446c69
7
+ data.tar.gz: fc2b9d1e38e1051c8d2045dadac317046a70570f5b543e51a287ba2553be8d6d0740e6d69f0038a66f4a85d875c2081b999fef8b26e91da569c5b05f4b080ef3
data/CHANGELOG.md CHANGED
@@ -1,357 +1,323 @@
1
- ## Rails 4.2.11.1 (March 11, 2019) ##
1
+ ## Rails 6.0.3.1 (May 18, 2020) ##
2
2
 
3
- * No changes.
4
-
5
-
6
- ## Rails 4.2.11 (November 27, 2018) ##
7
-
8
- * No changes.
9
-
10
-
11
- ## Rails 4.2.10 (September 27, 2017) ##
12
-
13
- * No changes.
14
-
15
-
16
- ## Rails 4.2.9 (June 26, 2017) ##
17
-
18
- * No changes.
19
-
20
-
21
- ## Rails 4.2.8 (February 21, 2017) ##
22
-
23
- * No changes.
24
-
25
-
26
- ## Rails 4.2.7 (July 12, 2016) ##
27
-
28
- * No changes.
29
-
30
-
31
- ## Rails 4.2.6 (March 07, 2016) ##
32
-
33
- * Fix stripping the digest from the automatically generated img tag alt
34
- attribute when assets are handled by Sprockets >=3.0.
3
+ * [CVE-2020-8167] Check that request is same-origin prior to including CSRF token in XHRs
35
4
 
36
- *Bart de Water*
5
+ ## Rails 6.0.3 (May 06, 2020) ##
37
6
 
38
- * Create a new `ActiveSupport::SafeBuffer` instance when `content_for` is flushed.
7
+ * annotated_source_code returns an empty array so TemplateErrors without a
8
+ template in the backtrace are surfaced properly by DebugExceptions.
39
9
 
40
- Fixes #19890
10
+ *Guilherme Mansur*, *Kasper Timm Hansen*
41
11
 
42
- *Yoong Kang Lim*
12
+ * Add autoload for SyntaxErrorInTemplate so syntax errors are correctly raised by DebugExceptions.
43
13
 
44
- * Respect value of `:object` if `:object` is false when rendering.
14
+ *Guilherme Mansur*, *Gannon McGibbon*
45
15
 
46
- Fixes #22260.
47
16
 
48
- *Yuichiro Kaneko*
17
+ ## Rails 6.0.2.2 (March 19, 2020) ##
49
18
 
50
- * Generate `week_field` input values using a 1-based index and not a 0-based index
51
- as per the W3 spec: http://www.w3.org/TR/html-markup/datatypes.html#form.data.week
19
+ * Fix possible XSS vector in escape_javascript helper
52
20
 
53
- *Christoph Geschwind*
54
-
55
-
56
- ## Rails 4.2.5.2 (February 26, 2016) ##
57
-
58
- * Do not allow render with unpermitted parameter.
59
-
60
- Fixes CVE-2016-2098.
61
-
62
- *Arthur Neves*
63
-
64
-
65
- ## Rails 4.2.5.1 (January 25, 2015) ##
66
-
67
- * Adds boolean argument outside_app_allowed to `ActionView::Resolver#find_templates`
68
- method.
21
+ CVE-2020-5267
69
22
 
70
23
  *Aaron Patterson*
71
24
 
72
25
 
73
- ## Rails 4.2.5 (November 12, 2015) ##
74
-
75
- * Fix `mail_to` when called with `nil` as argument.
76
-
77
- *Rafael Mendonça França*
78
-
79
- * `url_for` does not modify its arguments when generating polymorphic URLs.
26
+ ## Rails 6.0.2.1 (December 18, 2019) ##
80
27
 
81
- *Bernerd Schaefer*
28
+ * No changes.
82
29
 
83
30
 
84
- ## Rails 4.2.4 (August 24, 2015) ##
31
+ ## Rails 6.0.2 (December 13, 2019) ##
85
32
 
86
- * No Changes *
33
+ * No changes.
87
34
 
88
35
 
89
- ## Rails 4.2.3 (June 25, 2015) ##
36
+ ## Rails 6.0.1 (November 5, 2019) ##
90
37
 
91
- * `translate` should handle `raise` flag correctly in case of both main and default
92
- translation is missing.
38
+ * UJS avoids `Element.closest()` for IE 9 compatibility.
93
39
 
94
- Fixes #19967
40
+ *George Claghorn*
95
41
 
96
- *Bernard Potocki*
97
42
 
98
- * `translate` allows `default: [[]]` again for a default value of `[]`.
43
+ ## Rails 6.0.0 (August 16, 2019) ##
99
44
 
100
- Fixes #19640.
45
+ * ActionView::Helpers::SanitizeHelper: support rails-html-sanitizer 1.1.0.
101
46
 
102
- *Adam Prescott*
47
+ *Juanito Fatas*
103
48
 
104
- * `translate` should accept nils as members of the `:default`
105
- parameter without raising a translation missing error. Fixes a
106
- regression introduced 362557e.
107
49
 
108
- Fixes #19419
50
+ ## Rails 6.0.0.rc2 (July 22, 2019) ##
109
51
 
110
- *Justin Coyne*
52
+ * Fix `select_tag` so that it doesn't change `options` when `include_blank` is present.
111
53
 
112
- * `number_to_percentage` does not crash with `Float::NAN` or `Float::INFINITY`
113
- as input when `precision: 0` is used.
54
+ *Younes SERRAJ*
114
55
 
115
- Fixes #19227.
116
56
 
117
- *Yves Senn*
57
+ ## Rails 6.0.0.rc1 (April 24, 2019) ##
118
58
 
59
+ * Fix partial caching skips same item issue
119
60
 
120
- ## Rails 4.2.2 (June 16, 2015) ##
61
+ If we render cached collection partials with repeated items, those repeated items
62
+ will get skipped. For example, if you have 5 identical items in your collection, Rails
63
+ only renders the first one when `cached` is set to true. But it should render all
64
+ 5 items instead.
121
65
 
122
- * No Changes *
66
+ Fixes #35114.
123
67
 
68
+ *Stan Lo*
124
69
 
125
- ## Rails 4.2.1 (March 19, 2015) ##
70
+ * Only clear ActionView cache in development on file changes
126
71
 
127
- * Default translations that have a lower precedence than an html safe default,
128
- but are not themselves safe, should not be marked as html_safe.
72
+ To speed up development mode, view caches are only cleared when files in
73
+ the view paths have changed. Applications which have implemented custom
74
+ `ActionView::Resolver` subclasses may need to add their own cache clearing.
129
75
 
130
- *Justin Coyne*
76
+ *John Hawthorn*
131
77
 
132
- * Added an explicit error message, in `ActionView::PartialRenderer`
133
- for partial `rendering`, when the value of option `as` has invalid characters.
78
+ * Fix `ActionView::FixtureResolver` so that it handles template variants correctly.
134
79
 
135
- *Angelo Capilleri*
80
+ *Edward Rudd*
136
81
 
82
+ * `ActionView::TemplateRender.render(file: )` now renders the file directly,
83
+ without using any handlers, using the new `Template::RawFile` class.
137
84
 
138
- ## Rails 4.2.0 (December 20, 2014) ##
85
+ *John Hawthorn*, *Cliff Pruitt*
139
86
 
140
- * Local variable in a partial is now available even if a falsy value is
141
- passed to `:object` when rendering a partial.
142
87
 
143
- Fixes #17373.
88
+ ## Rails 6.0.0.beta3 (March 11, 2019) ##
144
89
 
145
- *Agis Anastasopoulos*
90
+ * Only accept formats from registered mime types
146
91
 
147
- * Add support for `:enforce_utf8` option in `form_for`.
92
+ A lack of filtering on mime types could allow an attacker to read
93
+ arbitrary files on the target server or to perform a denial of service
94
+ attack.
148
95
 
149
- This is the same option that was added in 06388b0 to `form_tag` and allows
150
- users to skip the insertion of the UTF8 enforcer tag in a form.
96
+ Fixes CVE-2019-5418
97
+ Fixes CVE-2019-5419
151
98
 
152
- * claudiob *
99
+ *John Hawthorn*, *Eileen M. Uchitelle*, *Aaron Patterson*
153
100
 
154
- * Fix a bug that <%= foo(){ %> and <%= foo()do %> in view templates were not regarded
155
- as Ruby block calls.
156
101
 
157
- * Akira Matsuda *
102
+ ## Rails 6.0.0.beta2 (February 25, 2019) ##
158
103
 
159
- * Update `select_tag` to work correctly with `:include_blank` option passing a string.
104
+ * `ActionView::Template.finalize_compiled_template_methods` is deprecated with
105
+ no replacement.
160
106
 
161
- Fixes #16483.
107
+ *tenderlove*
162
108
 
163
- *Frank Groeneveld*
109
+ * `config.action_view.finalize_compiled_template_methods` is deprecated with
110
+ no replacement.
164
111
 
165
- * Changed the meaning of `render "foo/bar"`.
112
+ *tenderlove*
166
113
 
167
- Previously, calling `render "foo/bar"` in a controller action is equivalent
168
- to `render file: "foo/bar"`. In Rails 4.2, this has been changed to mean
169
- `render template: "foo/bar"` instead. If you need to render a file, please
170
- change your code to use the explicit form (`render file: "foo/bar"`) instead.
114
+ * Ensure unique DOM IDs for collection inputs with float values.
171
115
 
172
- *Jeremy Jackson*
116
+ Fixes #34974.
173
117
 
174
- * Add support for ARIA attributes in tags.
118
+ *Mark Edmondson*
175
119
 
176
- Example:
120
+ * Single arity template handlers are deprecated. Template handlers must
121
+ now accept two parameters, the view object and the source for the view object.
177
122
 
178
- <%= f.text_field :name, aria: { required: "true", hidden: "false" } %>
123
+ *tenderlove*
179
124
 
180
- now generates:
181
125
 
182
- <input aria-hidden="false" aria-required="true" id="user_name" name="user[name]" type="text">
126
+ ## Rails 6.0.0.beta1 (January 18, 2019) ##
183
127
 
184
- *Paola Garcia Casadiego*
128
+ * [Rename npm package](https://github.com/rails/rails/pull/34905) from
129
+ [`rails-ujs`](https://www.npmjs.com/package/rails-ujs) to
130
+ [`@rails/ujs`](https://www.npmjs.com/package/@rails/ujs).
185
131
 
186
- * Provide a `builder` object when using the `label` form helper in block form.
132
+ *Javan Makhmali*
187
133
 
188
- The new `builder` object responds to `translation`, allowing I18n fallback support
189
- when you want to customize how a particular label is presented.
134
+ * Remove deprecated `image_alt` helper.
190
135
 
191
- *Alex Robbin*
136
+ *Rafael Mendonça França*
192
137
 
193
- * Add I18n support for input/textarea placeholder text.
138
+ * Fix the need of `#protect_against_forgery?` method defined in
139
+ `ActionView::Base` subclasses. This prevents the use of forms and buttons.
194
140
 
195
- Placeholder I18n follows the same convention as `label` I18n.
141
+ *Genadi Samokovarov*
196
142
 
197
- *Alex Robbin*
143
+ * Fix UJS permanently showing disabled text in a[data-remote][data-disable-with] elements within forms.
198
144
 
199
- * Fix that render layout: 'messages/layout' should also be added to the dependency tracker tree.
145
+ Fixes #33889.
200
146
 
201
- *DHH*
147
+ *Wolfgang Hobmaier*
202
148
 
203
- * Add `PartialIteration` object used when rendering collections.
149
+ * Prevent non-primary mouse keys from triggering Rails UJS click handlers.
150
+ Firefox fires click events even if the click was triggered by non-primary mouse keys such as right- or scroll-wheel-clicks.
151
+ 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.
204
152
 
205
- The iteration object is available as the local variable
206
- `#{template_name}_iteration` when rendering partials with collections.
153
+ ```
154
+ <%= link_to 'Remote', remote_path, class: 'remote', remote: true, data: { type: :json } %>
155
+ ```
207
156
 
208
- It gives access to the `size` of the collection being iterated over,
209
- the current `index` and two convenience methods `first?` and `last?`.
157
+ Fixes #34541.
210
158
 
211
- *Joel Junström*, *Lucas Uyezu*
159
+ *Wolfgang Hobmaier*
212
160
 
213
- * Return an absolute instead of relative path from an asset url in the case
214
- of the `asset_host` proc returning nil.
161
+ * Prevent `ActionView::TextHelper#word_wrap` from unexpectedly stripping white space from the _left_ side of lines.
215
162
 
216
- *Jolyon Pawlyn*
163
+ For example, given input like this:
217
164
 
218
- * Fix `html_escape_once` to properly handle hex escape sequences (e.g. &#x1a2b;).
165
+ ```
166
+ This is a paragraph with an initial indent,
167
+ followed by additional lines that are not indented,
168
+ and finally terminated with a blockquote:
169
+ "A pithy saying"
170
+ ```
219
171
 
220
- *John F. Douthat*
172
+ Calling `word_wrap` should not trim the indents on the first and last lines.
221
173
 
222
- * Added String support for min and max properties for date field helpers.
174
+ Fixes #34487.
223
175
 
224
- *Todd Bealmear*
176
+ *Lyle Mullican*
225
177
 
226
- * The `highlight` helper now accepts a block to be used instead of the `highlighter`
227
- option.
178
+ * Add allocations to template rendering instrumentation.
228
179
 
229
- *Lucas Mazza*
180
+ Adds the allocations for template and partial rendering to the server output on render.
230
181
 
231
- * The `except` and `highlight` helpers now accept regular expressions.
182
+ ```
183
+ Rendered posts/_form.html.erb (Duration: 7.1ms | Allocations: 6004)
184
+ Rendered posts/new.html.erb within layouts/application (Duration: 8.3ms | Allocations: 6654)
185
+ Completed 200 OK in 858ms (Views: 848.4ms | ActiveRecord: 0.4ms | Allocations: 1539564)
186
+ ```
232
187
 
233
- *Jan Szumiec*
188
+ *Eileen M. Uchitelle*, *Aaron Patterson*
234
189
 
235
- * Flatten the array parameter in `safe_join`, so it behaves consistently with
236
- `Array#join`.
190
+ * Respect the `only_path` option passed to `url_for` when the options are passed in as an array
237
191
 
238
- *Paul Grayson*
192
+ Fixes #33237.
239
193
 
240
- * Honor `html_safe` on array elements in tag values, as we do for plain string
241
- values.
194
+ *Joel Ambass*
242
195
 
243
- *Paul Grayson*
196
+ * Deprecate calling private model methods from view helpers.
244
197
 
245
- * Add `ActionView::Template::Handler.unregister_template_handler`.
198
+ For example, in methods like `options_from_collection_for_select`
199
+ and `collection_select` it is possible to call private methods from
200
+ the objects used.
246
201
 
247
- It performs the opposite of `ActionView::Template::Handler.register_template_handler`.
202
+ Fixes #33546.
248
203
 
249
- *Zuhao Wan*
204
+ *Ana María Martínez Gómez*
250
205
 
251
- * Bring `cache_digest` rake tasks up-to-date with the latest API changes.
206
+ * Fix issue with `button_to`'s `to_form_params`
252
207
 
253
- *Jiri Pospisil*
208
+ `button_to` was throwing exception when invoked with `params` hash that
209
+ contains symbol and string keys. The reason for the exception was that
210
+ `to_form_params` was comparing the given symbol and string keys.
254
211
 
255
- * Allow custom `:host` option to be passed to `asset_url` helper that
256
- overwrites `config.action_controller.asset_host` for particular asset.
212
+ The issue is fixed by turning all keys to strings inside
213
+ `to_form_params` before comparing them.
257
214
 
258
- *Hubert Łępicki*
215
+ *Georgi Georgiev*
259
216
 
260
- * Deprecate `AbstractController::Base.parent_prefixes`.
261
- Override `AbstractController::Base.local_prefixes` when you want to change
262
- where to find views.
217
+ * Mark arrays of translations as trusted safe by using the `_html` suffix.
263
218
 
264
- *Nick Sutterer*
219
+ Example:
265
220
 
266
- * Take label values into account when doing I18n lookups for model attributes.
221
+ en:
222
+ foo_html:
223
+ - "One"
224
+ - "<strong>Two</strong>"
225
+ - "Three &#128075; &#128578;"
267
226
 
268
- The following:
227
+ *Juan Broullon*
269
228
 
270
- # form.html.erb
271
- <%= form_for @post do |f| %>
272
- <%= f.label :type, value: "long" %>
273
- <% end %>
229
+ * Add `year_format` option to date_select tag. This option makes it possible to customize year
230
+ names. Lambda should be passed to use this option.
274
231
 
275
- # en.yml
276
- en:
277
- activerecord:
278
- attributes:
279
- post/long: "Long-form Post"
232
+ Example:
280
233
 
281
- Used to simply return "long", but now it will return "Long-form
282
- Post".
234
+ date_select('user_birthday', '', start_year: 1998, end_year: 2000, year_format: ->year { "Heisei #{year - 1988}" })
283
235
 
284
- *Joshua Cody*
236
+ The HTML produced:
285
237
 
286
- * Change `asset_path` to use File.join to create proper paths:
238
+ <select id="user_birthday__1i" name="user_birthday[(1i)]">
239
+ <option value="1998">Heisei 10</option>
240
+ <option value="1999">Heisei 11</option>
241
+ <option value="2000">Heisei 12</option>
242
+ </select>
243
+ /* The rest is omitted */
287
244
 
288
- Before:
245
+ *Koki Ryu*
289
246
 
290
- https://some.host.com//assets/some.js
247
+ * Fix JavaScript views rendering does not work with Firefox when using
248
+ Content Security Policy.
291
249
 
292
- After:
250
+ Fixes #32577.
293
251
 
294
- https://some.host.com/assets/some.js
252
+ *Yuji Yaginuma*
295
253
 
296
- *Peter Schröder*
254
+ * Add the `nonce: true` option for `javascript_include_tag` helper to
255
+ support automatic nonce generation for Content Security Policy.
256
+ Works the same way as `javascript_tag nonce: true` does.
297
257
 
298
- * Change `favicon_link_tag` default mimetype from `image/vnd.microsoft.icon` to
299
- `image/x-icon`.
258
+ *Yaroslav Markin*
300
259
 
301
- Before:
260
+ * Remove `ActionView::Helpers::RecordTagHelper`.
302
261
 
303
- # => favicon_link_tag 'myicon.ico'
304
- <link href="/assets/myicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
262
+ *Yoshiyuki Hirano*
305
263
 
306
- After:
264
+ * Disable `ActionView::Template` finalizers in test environment.
307
265
 
308
- # => favicon_link_tag 'myicon.ico'
309
- <link href="/assets/myicon.ico" rel="shortcut icon" type="image/x-icon" />
266
+ Template finalization can be expensive in large view test suites.
267
+ Add a configuration option,
268
+ `action_view.finalize_compiled_template_methods`, and turn it off in
269
+ the test environment.
310
270
 
311
- *Geoffroy Lorieux*
271
+ *Simon Coffey*
312
272
 
313
- * Remove wrapping div with inline styles for hidden form fields.
273
+ * Extract the `confirm` call in its own, overridable method in `rails_ujs`.
314
274
 
315
- We are dropping HTML 4.01 and XHTML strict compliance since input tags directly
316
- inside a form are valid HTML5, and the absence of inline styles help in validating
317
- for Content Security Policy.
275
+ Example:
318
276
 
319
- *Joost Baaij*
277
+ Rails.confirm = function(message, element) {
278
+ return (my_bootstrap_modal_confirm(message));
279
+ }
320
280
 
321
- * `collection_check_boxes` respects `:index` option for the hidden field name.
281
+ *Mathieu Mahé*
322
282
 
323
- Fixes #14147.
283
+ * Enable select tag helper to mark `prompt` option as `selected` and/or `disabled` for `required`
284
+ field.
324
285
 
325
- *Vasiliy Ermolovich*
286
+ Example:
326
287
 
327
- * `date_select` helper with option `with_css_classes: true` does not overwrite other classes.
288
+ select :post,
289
+ :category,
290
+ ["lifestyle", "programming", "spiritual"],
291
+ { selected: "", disabled: "", prompt: "Choose one" },
292
+ { required: true }
328
293
 
329
- *Izumi Wong-Horiuchi*
294
+ Placeholder option would be selected and disabled.
330
295
 
331
- * `number_to_percentage` does not crash with `Float::NAN` or `Float::INFINITY`
332
- as input.
296
+ The HTML produced:
333
297
 
334
- Fixes #14405.
298
+ <select required="required" name="post[category]" id="post_category">
299
+ <option disabled="disabled" selected="selected" value="">Choose one</option>
300
+ <option value="lifestyle">lifestyle</option>
301
+ <option value="programming">programming</option>
302
+ <option value="spiritual">spiritual</option></select>
335
303
 
336
- *Yves Senn*
304
+ *Sergey Prikhodko*
337
305
 
338
- * Add `include_hidden` option to `collection_check_boxes` helper.
306
+ * Don't enforce UTF-8 by default.
339
307
 
340
- *Vasiliy Ermolovich*
308
+ With the disabling of TLS 1.0 by most major websites, continuing to run
309
+ IE8 or lower becomes increasingly difficult so default to not enforcing
310
+ UTF-8 encoding as it's not relevant to other browsers.
341
311
 
342
- * Fixed a problem where the default options for the `button_tag` helper are not
343
- applied correctly.
312
+ *Andrew White*
344
313
 
345
- Fixes #14254.
314
+ * Change translation key of `submit_tag` from `module_name_class_name` to `module_name/class_name`.
346
315
 
347
- *Sergey Prikhodko*
316
+ *Rui Onodera*
348
317
 
349
- * Take variants into account when calculating template digests in ActionView::Digestor.
318
+ * Rails 6 requires Ruby 2.5.0 or newer.
350
319
 
351
- The arguments to ActionView::Digestor#digest are now being passed as a hash
352
- to support variants and allow more flexibility in the future. The support for
353
- regular (required) arguments is deprecated and will be removed in Rails 5.0 or later.
320
+ *Jeremy Daer*, *Kasper Timm Hansen*
354
321
 
355
- *Piotr Chmolowski, Łukasz Strzałkowski*
356
322
 
357
- Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/actionview/CHANGELOG.md) for previous changes.
323
+ Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/actionview/CHANGELOG.md) for previous changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2014 David Heinemeier Hansson
1
+ Copyright (c) 2004-2019 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
@@ -5,35 +5,36 @@ 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://edgeguides.rubyonrails.org/action_view_overview.html] guide.
9
+
8
10
  == Download and installation
9
11
 
10
12
  The latest version of Action View can be installed with RubyGems:
11
13
 
12
- % [sudo] gem install actionview
14
+ $ gem install actionview
13
15
 
14
- Source code can be downloaded as part of the Rails project on GitHub
16
+ Source code can be downloaded as part of the Rails project on GitHub:
15
17
 
16
- * https://github.com/rails/rails/tree/4-2-stable/actionview
18
+ * https://github.com/rails/rails/tree/master/actionview
17
19
 
18
20
 
19
21
  == License
20
22
 
21
23
  Action View is released under the MIT license:
22
24
 
23
- * http://www.opensource.org/licenses/MIT
25
+ * https://opensource.org/licenses/MIT
24
26
 
25
27
 
26
28
  == Support
27
29
 
28
30
  API documentation is at
29
31
 
30
- * http://api.rubyonrails.org
32
+ * https://api.rubyonrails.org
31
33
 
32
- Bug reports can be filed for the Ruby on Rails project here:
34
+ Bug reports for the Ruby on Rails project can be filed here:
33
35
 
34
36
  * https://github.com/rails/rails/issues
35
37
 
36
38
  Feature requests should be discussed on the rails-core mailing list here:
37
39
 
38
- * https://groups.google.com/forum/?fromgroups#!forum/rubyonrails-core
39
-
40
+ * https://discuss.rubyonrails.org/c/rubyonrails-core