actionview 6.1.7.4 → 7.0.0.alpha1

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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +89 -379
  3. data/MIT-LICENSE +2 -1
  4. data/lib/action_view/base.rb +3 -3
  5. data/lib/action_view/buffers.rb +2 -2
  6. data/lib/action_view/cache_expiry.rb +46 -32
  7. data/lib/action_view/dependency_tracker/erb_tracker.rb +154 -0
  8. data/lib/action_view/dependency_tracker/ripper_tracker.rb +59 -0
  9. data/lib/action_view/dependency_tracker.rb +6 -147
  10. data/lib/action_view/digestor.rb +7 -4
  11. data/lib/action_view/flows.rb +4 -4
  12. data/lib/action_view/gem_version.rb +4 -4
  13. data/lib/action_view/helpers/active_model_helper.rb +1 -1
  14. data/lib/action_view/helpers/asset_tag_helper.rb +84 -29
  15. data/lib/action_view/helpers/asset_url_helper.rb +7 -7
  16. data/lib/action_view/helpers/atom_feed_helper.rb +3 -4
  17. data/lib/action_view/helpers/cache_helper.rb +51 -3
  18. data/lib/action_view/helpers/capture_helper.rb +2 -2
  19. data/lib/action_view/helpers/controller_helper.rb +2 -2
  20. data/lib/action_view/helpers/csp_helper.rb +1 -1
  21. data/lib/action_view/helpers/csrf_helper.rb +1 -1
  22. data/lib/action_view/helpers/date_helper.rb +6 -7
  23. data/lib/action_view/helpers/debug_helper.rb +3 -1
  24. data/lib/action_view/helpers/form_helper.rb +72 -12
  25. data/lib/action_view/helpers/form_options_helper.rb +65 -33
  26. data/lib/action_view/helpers/form_tag_helper.rb +75 -32
  27. data/lib/action_view/helpers/javascript_helper.rb +3 -5
  28. data/lib/action_view/helpers/number_helper.rb +3 -4
  29. data/lib/action_view/helpers/output_safety_helper.rb +2 -2
  30. data/lib/action_view/helpers/rendering_helper.rb +1 -1
  31. data/lib/action_view/helpers/sanitize_helper.rb +2 -2
  32. data/lib/action_view/helpers/tag_helper.rb +25 -44
  33. data/lib/action_view/helpers/tags/base.rb +3 -15
  34. data/lib/action_view/helpers/tags/check_box.rb +2 -2
  35. data/lib/action_view/helpers/tags/collection_select.rb +1 -1
  36. data/lib/action_view/helpers/tags/hidden_field.rb +0 -4
  37. data/lib/action_view/helpers/tags/time_field.rb +10 -1
  38. data/lib/action_view/helpers/tags/weekday_select.rb +27 -0
  39. data/lib/action_view/helpers/tags.rb +3 -2
  40. data/lib/action_view/helpers/text_helper.rb +24 -13
  41. data/lib/action_view/helpers/translation_helper.rb +1 -2
  42. data/lib/action_view/helpers/url_helper.rb +102 -77
  43. data/lib/action_view/helpers.rb +25 -25
  44. data/lib/action_view/lookup_context.rb +33 -52
  45. data/lib/action_view/model_naming.rb +1 -1
  46. data/lib/action_view/path_set.rb +16 -22
  47. data/lib/action_view/railtie.rb +14 -1
  48. data/lib/action_view/render_parser.rb +188 -0
  49. data/lib/action_view/renderer/abstract_renderer.rb +2 -2
  50. data/lib/action_view/renderer/partial_renderer.rb +0 -34
  51. data/lib/action_view/renderer/renderer.rb +4 -4
  52. data/lib/action_view/renderer/streaming_template_renderer.rb +3 -3
  53. data/lib/action_view/renderer/template_renderer.rb +6 -2
  54. data/lib/action_view/rendering.rb +2 -2
  55. data/lib/action_view/ripper_ast_parser.rb +198 -0
  56. data/lib/action_view/routing_url_for.rb +1 -1
  57. data/lib/action_view/template/error.rb +108 -13
  58. data/lib/action_view/template/handlers/erb.rb +6 -0
  59. data/lib/action_view/template/handlers.rb +3 -3
  60. data/lib/action_view/template/html.rb +3 -3
  61. data/lib/action_view/template/inline.rb +3 -3
  62. data/lib/action_view/template/raw_file.rb +3 -3
  63. data/lib/action_view/template/resolver.rb +84 -311
  64. data/lib/action_view/template/text.rb +3 -3
  65. data/lib/action_view/template/types.rb +14 -12
  66. data/lib/action_view/template.rb +10 -1
  67. data/lib/action_view/template_details.rb +66 -0
  68. data/lib/action_view/template_path.rb +64 -0
  69. data/lib/action_view/test_case.rb +6 -2
  70. data/lib/action_view/testing/resolvers.rb +11 -12
  71. data/lib/action_view/unbound_template.rb +33 -7
  72. data/lib/action_view.rb +3 -4
  73. data/lib/assets/compiled/rails-ujs.js +5 -36
  74. metadata +25 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebf466e8a6862842a59c3e61b9e665074eaf1816aebdc18d43a000de3f7ea63e
4
- data.tar.gz: 714140f9e576e40753b3055b91b152e28fccff2e5233112183c947eabf7c43f5
3
+ metadata.gz: 488edff5bf41873248138efbc0c8ee4ecd1809793a99ebe520870d35e2a6e459
4
+ data.tar.gz: 429fd7c60ef3fb02df47871d05a7289cfda25e21586928dc1accebaa45678a7d
5
5
  SHA512:
6
- metadata.gz: 44b1f1785b64bddc9bbcd976c5f54de4be6689527965c3f76d9d7417bd7435e73b4471469f347c2e8cf174a13b395ffff9465c20eb51b193edb86a179010a0b1
7
- data.tar.gz: 69085c23f26a8209b1786d773e7bf2d4141254c5f03ceb0317be6afde1a4a48c9f95c0379c823174e1cdc10cd59258b2f9d1e09af993346335224bac8ee0f812
6
+ metadata.gz: 3db204604fb84ce3ab96976aad76fffb4938a2ec6ad7f965b2dc59a785622888867f92df3282ae560d6fb594fecc215a1c18340329ea912bed58c74d457e6824
7
+ data.tar.gz: 7eb29f984ea723f25728f8ae0c06127b7728501e18e690b0b73972d34a3bd467783760c293d50bc474f1fba9ddc824c02678af7653edcab8a5703766a572b96f
data/CHANGELOG.md CHANGED
@@ -1,163 +1,109 @@
1
- ## Rails 6.1.7.4 (June 26, 2023) ##
1
+ ## Rails 7.0.0.alpha1 (September 15, 2021) ##
2
2
 
3
- * No changes.
3
+ * Improves the performance of ActionView::Helpers::NumberHelper formatters by avoiding the use of
4
+ exceptions as flow control.
4
5
 
6
+ *Mike Dalessio*
5
7
 
6
- ## Rails 6.1.7.3 (March 13, 2023) ##
7
-
8
- * Ignore certain data-* attributes in rails-ujs when element is contenteditable
9
-
10
- [CVE-2023-23913]
11
-
12
-
13
- ## Rails 6.1.7.2 (January 24, 2023) ##
14
-
15
- * No changes.
16
-
17
-
18
- ## Rails 6.1.7.1 (January 17, 2023) ##
19
-
20
- * No changes.
21
-
22
-
23
- ## Rails 6.1.7 (September 09, 2022) ##
24
-
25
- * No changes.
26
-
27
-
28
- ## Rails 6.1.6.1 (July 12, 2022) ##
29
-
30
- * No changes.
31
-
32
-
33
- ## Rails 6.1.6 (May 09, 2022) ##
34
-
35
- * No changes.
36
-
37
-
38
- ## Rails 6.1.5.1 (April 26, 2022) ##
39
-
40
- * Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
41
-
42
- Escape dangerous characters in names of tags and names of attributes in the
43
- tag helpers, following the XML specification. Rename the option
44
- `:escape_attributes` to `:escape`, to simplify by applying the option to the
45
- whole tag.
46
-
47
- *Álvaro Martín Fraguas*
48
-
49
- ## Rails 6.1.5 (March 09, 2022) ##
50
-
51
- * `preload_link_tag` properly inserts `as` attributes for files with `image` MIME
52
- types, such as JPG or SVG.
8
+ * `preload_link_tag` properly inserts `as` attributes for files with `image` MIME types, such as JPG or SVG.
53
9
 
54
10
  *Nate Berkopec*
55
11
 
56
- * Add `autocomplete="off"` to all generated hidden fields.
57
-
58
- Fixes #42610.
59
-
60
- *Ryan Baumann*
61
-
62
- * Fix `current_page?` when URL has trailing slash.
63
-
64
- This fixes the `current_page?` helper when the given URL has a trailing slash,
65
- and is an absolute URL or also has query params.
66
-
67
- Fixes #33956.
68
-
69
- *Jonathan Hefner*
70
-
12
+ * Add `weekday_options_for_select` and `weekday_select` helper methods. Also adds `weekday_select` to `FormBuilder`.
71
13
 
72
- ## Rails 6.1.4.7 (March 08, 2022) ##
14
+ *Drew Bragg*, *Dana Kashubeck*, *Kasper Timm Hansen*
73
15
 
74
- * No changes.
16
+ * 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.
75
17
 
18
+ *Ben Toews*, *John Hawthorn*, *Kasper Timm Hansen*, *Joel Hawksley*
76
19
 
77
- ## Rails 6.1.4.6 (February 11, 2022) ##
20
+ * Add `include_seconds` option for `time_field`.
78
21
 
79
- * No changes.
22
+ <%= form.time_field :foo, include_seconds: false %>
23
+ # => <input value="16:22" type="time" />
80
24
 
25
+ Default includes seconds:
81
26
 
82
- ## Rails 6.1.4.5 (February 11, 2022) ##
27
+ <%= form.time_field :foo %>
28
+ # => <input value="16:22:01.440" type="time" />
83
29
 
84
- * No changes.
30
+ This allows you to take advantage of [different rendering options](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time#time_value_format) in some browsers.
85
31
 
32
+ *Alex Ghiculescu*
86
33
 
87
- ## Rails 6.1.4.4 (December 15, 2021) ##
34
+ * Improve error messages when template file does not exist at absolute filepath.
88
35
 
89
- * No changes.
36
+ *Ted Whang*
90
37
 
38
+ * Add `:country_code` option to `sms_to` for consistency with `phone_to`.
91
39
 
92
- ## Rails 6.1.4.3 (December 14, 2021) ##
93
-
94
- * No changes.
95
-
96
-
97
- ## Rails 6.1.4.2 (December 14, 2021) ##
98
-
99
- * No changes.
100
-
101
-
102
- ## Rails 6.1.4.1 (August 19, 2021) ##
103
-
104
- * No changes.
40
+ *Jonathan Hefner*
105
41
 
42
+ * OpenSSL constants are now used for Digest computations.
106
43
 
107
- ## Rails 6.1.4 (June 24, 2021) ##
44
+ *Dirkjan Bussink*
108
45
 
109
46
  * The `translate` helper now passes `default` values that aren't
110
47
  translation keys through `I18n.translate` for interpolation.
111
48
 
112
49
  *Jonathan Hefner*
113
50
 
114
- * Don't attach UJS form submission handlers to Turbo forms.
115
-
116
- *David Heinemeier Hansson*
117
-
118
- * Allow both `current_page?(url_hash)` and `current_page?(**url_hash)` on Ruby 2.7.
51
+ * Adds option `extname` to `stylesheet_link_tag` to skip default
52
+ `.css` extension appended to the stylesheet path.
119
53
 
120
- *Ryuta Kamizono*
54
+ Before:
121
55
 
56
+ ```ruby
57
+ stylesheet_link_tag "style.less"
58
+ # <link href="/stylesheets/style.less.scss" rel="stylesheet">
59
+ ```
122
60
 
123
- ## Rails 6.1.3.2 (May 05, 2021) ##
124
-
125
- * No changes.
126
-
127
-
128
- ## Rails 6.1.3.1 (March 26, 2021) ##
129
-
130
- * No changes.
131
-
132
-
133
- ## Rails 6.1.3 (February 17, 2021) ##
134
-
135
- * No changes.
136
-
61
+ After:
137
62
 
138
- ## Rails 6.1.2.1 (February 10, 2021) ##
63
+ ```ruby
64
+ stylesheet_link_tag "style.less", extname: false, skip_pipeline: true, rel: "stylesheet/less"
65
+ # <link href="/stylesheets/style.less" rel="stylesheet/less">
66
+ ```
139
67
 
140
- * No changes.
68
+ *Abhay Nikam*
141
69
 
70
+ * Deprecate `render` locals to be assigned to instance variables.
142
71
 
143
- ## Rails 6.1.2 (February 09, 2021) ##
72
+ *Petrik de Heus*
144
73
 
145
- * No changes.
74
+ * Remove legacy default `media=screen` from `stylesheet_link_tag`.
146
75
 
76
+ *André Luis Leal Cardoso Junior*
147
77
 
148
- ## Rails 6.1.1 (January 07, 2021) ##
78
+ * Change `ActionView::Helpers::FormBuilder#button` to transform `formmethod`
79
+ attributes into `_method="$VERB"` Form Data to enable varied same-form actions:
149
80
 
150
- * Fix lazy translation in partial with block.
81
+ <%= form_with model: post, method: :put do %>
82
+ <%= form.button "Update" %>
83
+ <%= form.button "Delete", formmethod: :delete %>
84
+ <% end %>
85
+ <%# => <form action="posts/1">
86
+ => <input type="hidden" name="_method" value="put">
87
+ => <button type="submit">Update</button>
88
+ => <button type="submit" formmethod="post" name="_method" value="delete">Delete</button>
89
+ => </form>
90
+ %>
151
91
 
152
- *Marek Kasztelnik*
92
+ *Sean Doyle*
153
93
 
154
- * Avoid extra `SELECT COUNT` queries when rendering Active Record collections.
94
+ * Change `ActionView::Helpers::UrlHelper#button_to` to *always* render a
95
+ `<button>` element, regardless of whether or not the content is passed as
96
+ the first argument or as a block.
155
97
 
156
- *aar0nr*
98
+ <%= button_to "Delete", post_path(@post), method: :delete %>
99
+ # => <form action="/posts/1"><input type="hidden" name="_method" value="delete"><button type="submit">Delete</button></form>
157
100
 
158
- * Link preloading keep integrity hashes in the header.
101
+ <%= button_to post_path(@post), method: :delete do %>
102
+ Delete
103
+ <% end %>
104
+ # => <form action="/posts/1"><input type="hidden" name="_method" value="delete"><button type="submit">Delete</button></form>
159
105
 
160
- *Étienne Barrié*
106
+ *Sean Doyle*, *Dusan Orlovic*
161
107
 
162
108
  * Add `config.action_view.preload_links_header` to allow disabling of
163
109
  the `Link` header being added by default when using `stylesheet_link_tag`
@@ -170,282 +116,46 @@
170
116
 
171
117
  *Jonathan Hefner*
172
118
 
119
+ * Add `config.action_view.image_loading` to configure the default value of
120
+ the `image_tag` `:loading` option.
173
121
 
174
- ## Rails 6.1.0 (December 09, 2020) ##
175
-
176
- * SanitizeHelper.sanitized_allowed_attributes and SanitizeHelper.sanitized_allowed_tags
177
- call safe_list_sanitizer's class method
178
-
179
- Fixes #39586
180
-
181
- *Taufiq Muhammadi*
182
-
183
- * Change form_with to generate non-remote forms by default.
184
-
185
- `form_with` would generate a remote form by default. This would confuse
186
- users because they were forced to handle remote requests.
122
+ By setting `config.action_view.image_loading = "lazy"`, an application can opt in to
123
+ lazy loading images sitewide, without changing view code.
187
124
 
188
- All new 6.1 applications will generate non-remote forms by default.
189
- When upgrading a 6.0 application you can enable remote forms by default by
190
- setting `config.action_view.form_with_generates_remote_forms` to `true`.
191
-
192
- *Petrik de Heus*
193
-
194
- * Yield translated strings to calls of `ActionView::FormBuilder#button`
195
- when a block is given.
196
-
197
- *Sean Doyle*
198
-
199
- * Alias `ActionView::Helpers::Tags::Label::LabelBuilder#translation` to
200
- `#to_s` so that `form.label` calls can yield that value to their blocks.
201
-
202
- *Sean Doyle*
203
-
204
- * Rename the new `TagHelper#class_names` method to `TagHelper#token_list`,
205
- and make the original available as an alias.
125
+ *Jonathan Hefner*
206
126
 
207
- token_list("foo", "foo bar")
208
- # => "foo bar"
127
+ * `ActionView::Helpers::FormBuilder#id` returns the value
128
+ of the `<form>` element's `id` attribute. With a `method` argument, returns
129
+ the `id` attribute for a form field with that name.
209
130
 
210
- *Sean Doyle*
131
+ <%= form_for @post do |f| %>
132
+ <%# ... %>
211
133
 
212
- * ARIA Array and Hash attributes are treated as space separated `DOMTokenList`
213
- values. This is useful when declaring lists of label text identifiers in
214
- `aria-labelledby` or `aria-describedby`.
215
-
216
- tag.input type: 'checkbox', name: 'published', aria: {
217
- invalid: @post.errors[:published].any?,
218
- labelledby: ['published_context', 'published_label'],
219
- describedby: { published_errors: @post.errors[:published].any? }
220
- }
221
- #=> <input
222
- type="checkbox" name="published" aria-invalid="true"
223
- aria-labelledby="published_context published_label"
224
- aria-describedby="published_errors"
225
- >
134
+ <% content_for :sticky_footer do %>
135
+ <%= form.button(form: f.id) %>
136
+ <% end %>
137
+ <% end %>
226
138
 
227
139
  *Sean Doyle*
228
140
 
229
- * Remove deprecated `escape_whitelist` from `ActionView::Template::Handlers::ERB`.
230
-
231
- *Rafael Mendonça França*
232
-
233
- * Remove deprecated `find_all_anywhere` from `ActionView::Resolver`.
234
-
235
- *Rafael Mendonça França*
236
-
237
- * Remove deprecated `formats` from `ActionView::Template::HTML`.
238
-
239
- *Rafael Mendonça França*
240
-
241
- * Remove deprecated `formats` from `ActionView::Template::RawFile`.
242
-
243
- *Rafael Mendonça França*
244
-
245
- * Remove deprecated `formats` from `ActionView::Template::Text`.
141
+ * `ActionView::Helpers::FormBuilder#field_id` returns the value generated by
142
+ the FormBuilder for the given attribute name.
246
143
 
247
- *Rafael Mendonça França*
248
-
249
- * Remove deprecated `find_file` from `ActionView::PathSet`.
250
-
251
- *Rafael Mendonça França*
252
-
253
- * Remove deprecated `rendered_format` from `ActionView::LookupContext`.
254
-
255
- *Rafael Mendonça França*
256
-
257
- * Remove deprecated `find_file` from `ActionView::ViewPaths`.
258
-
259
- *Rafael Mendonça França*
260
-
261
- * Require that `ActionView::Base` subclasses implement `#compiled_method_container`.
262
-
263
- *Rafael Mendonça França*
264
-
265
- * Remove deprecated support to pass an object that is not a `ActionView::LookupContext` as the first argument
266
- in `ActionView::Base#initialize`.
267
-
268
- *Rafael Mendonça França*
269
-
270
- * Remove deprecated `format` argument `ActionView::Base#initialize`.
271
-
272
- *Rafael Mendonça França*
273
-
274
- * Remove deprecated `ActionView::Template#refresh`.
275
-
276
- *Rafael Mendonça França*
277
-
278
- * Remove deprecated `ActionView::Template#original_encoding`.
279
-
280
- *Rafael Mendonça França*
281
-
282
- * Remove deprecated `ActionView::Template#variants`.
283
-
284
- *Rafael Mendonça França*
285
-
286
- * Remove deprecated `ActionView::Template#formats`.
287
-
288
- *Rafael Mendonça França*
289
-
290
- * Remove deprecated `ActionView::Template#virtual_path=`.
291
-
292
- *Rafael Mendonça França*
293
-
294
- * Remove deprecated `ActionView::Template#updated_at`.
295
-
296
- *Rafael Mendonça França*
297
-
298
- * Remove deprecated `updated_at` argument required on `ActionView::Template#initialize`.
299
-
300
- *Rafael Mendonça França*
301
-
302
- * Make `locals` argument required on `ActionView::Template#initialize`.
303
-
304
- *Rafael Mendonça França*
305
-
306
- * Remove deprecated `ActionView::Template.finalize_compiled_template_methods`.
307
-
308
- *Rafael Mendonça França*
309
-
310
- * Remove deprecated `config.action_view.finalize_compiled_template_methods`
311
-
312
- *Rafael Mendonça França*
313
-
314
- * Remove deprecated support to calling `ActionView::ViewPaths#with_fallback` with a block.
315
-
316
- *Rafael Mendonça França*
317
-
318
- * Remove deprecated support to passing absolute paths to `render template:`.
319
-
320
- *Rafael Mendonça França*
321
-
322
- * Remove deprecated support to passing relative paths to `render file:`.
323
-
324
- *Rafael Mendonça França*
325
-
326
- * Remove support to template handlers that don't accept two arguments.
327
-
328
- *Rafael Mendonça França*
329
-
330
- * Remove deprecated pattern argument in `ActionView::Template::PathResolver`.
331
-
332
- *Rafael Mendonça França*
333
-
334
- * Remove deprecated support to call private methods from object in some view helpers.
335
-
336
- *Rafael Mendonça França*
337
-
338
- * `ActionView::Helpers::TranslationHelper#translate` accepts a block, yielding
339
- the translated text and the fully resolved translation key:
340
-
341
- <%= translate(".relative_key") do |translation, resolved_key| %>
342
- <span title="<%= resolved_key %>"><%= translation %></span>
144
+ <%= form_for @post do |f| %>
145
+ <%= f.label :title %>
146
+ <%= f.text_field :title, aria: { describedby: f.field_id(:title, :error) } %>
147
+ <%= tag.span("is blank", id: f.field_id(:title, :error) %>
343
148
  <% end %>
344
149
 
345
150
  *Sean Doyle*
346
151
 
347
- * Ensure cache fragment digests include all relevant template dependencies when
348
- fragments are contained in a block passed to the render helper. Remove the
349
- virtual_path keyword arguments found in CacheHelper as they no longer possess
350
- any function following 1581cab.
351
-
352
- Fixes #38984.
353
-
354
- *Aaron Lipman*
355
-
356
- * Deprecate `config.action_view.raise_on_missing_translations` in favor of
357
- `config.i18n.raise_on_missing_translations`.
358
-
359
- New generalized configuration option now determines whether an error should be raised
360
- for missing translations in controllers and views.
361
-
362
- *fatkodima*
363
-
364
- * Instrument layout rendering in `TemplateRenderer#render_with_layout` as `render_layout.action_view`,
365
- and include (when necessary) the layout's virtual path in notification payloads for collection and partial renders.
366
-
367
- *Zach Kemp*
368
-
369
- * `ActionView::Base.annotate_rendered_view_with_filenames` annotates HTML output with template file names.
370
-
371
- *Joel Hawksley*, *Aaron Patterson*
372
-
373
- * `ActionView::Helpers::TranslationHelper#translate` returns nil when
374
- passed `default: nil` without a translation matching `I18n#translate`.
375
-
376
- *Stefan Wrobel*
377
-
378
- * `OptimizedFileSystemResolver` prefers template details in order of locale,
379
- formats, variants, handlers.
380
-
381
- *Iago Pimenta*
382
-
383
- * Added `class_names` helper to create a CSS class value with conditional classes.
384
-
385
- *Joel Hawksley*, *Aaron Patterson*
386
-
387
- * Add support for conditional values to TagBuilder.
152
+ * Add `tag.attributes` to transform a Hash into HTML Attributes, ready to be
153
+ interpolated into ERB.
388
154
 
389
- *Joel Hawksley*
155
+ <input <%= tag.attributes(type: :text, aria: { label: "Search" }) %> >
156
+ # => <input type="text" aria-label="Search">
390
157
 
391
- * `ActionView::Helpers::FormOptionsHelper#select` should mark option for `nil` as selected.
392
-
393
- ```ruby
394
- @post = Post.new
395
- @post.category = nil
396
-
397
- # Before
398
- select("post", "category", none: nil, programming: 1, economics: 2)
399
- # =>
400
- # <select name="post[category]" id="post_category">
401
- # <option value="">none</option>
402
- # <option value="1">programming</option>
403
- # <option value="2">economics</option>
404
- # </select>
405
-
406
- # After
407
- select("post", "category", none: nil, programming: 1, economics: 2)
408
- # =>
409
- # <select name="post[category]" id="post_category">
410
- # <option selected="selected" value="">none</option>
411
- # <option value="1">programming</option>
412
- # <option value="2">economics</option>
413
- # </select>
414
- ```
415
-
416
- *bogdanvlviv*
417
-
418
- * Log lines for partial renders and started template renders are now
419
- emitted at the `DEBUG` level instead of `INFO`.
420
-
421
- Completed template renders are still logged at the `INFO` level.
422
-
423
- *DHH*
424
-
425
- * ActionView::Helpers::SanitizeHelper: support rails-html-sanitizer 1.1.0.
426
-
427
- *Juanito Fatas*
428
-
429
- * Added `phone_to` helper method to create a link from mobile numbers.
430
-
431
- *Pietro Moro*
432
-
433
- * annotated_source_code returns an empty array so TemplateErrors without a
434
- template in the backtrace are surfaced properly by DebugExceptions.
435
-
436
- *Guilherme Mansur*, *Kasper Timm Hansen*
437
-
438
- * Add autoload for SyntaxErrorInTemplate so syntax errors are correctly raised by DebugExceptions.
439
-
440
- *Guilherme Mansur*, *Gannon McGibbon*
441
-
442
- * `RenderingHelper` supports rendering objects that `respond_to?` `:render_in`.
443
-
444
- *Joel Hawksley*, *Natasha Umer*, *Aaron Patterson*, *Shawn Allen*, *Emily Plummer*, *Diana Mounter*, *John Hawthorn*, *Nathan Herald*, *Zaid Zawaideh*, *Zach Ahn*
445
-
446
- * Fix `select_tag` so that it doesn't change `options` when `include_blank` is present.
447
-
448
- *Younes SERRAJ*
158
+ *Sean Doyle*
449
159
 
450
160
 
451
- Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actionview/CHANGELOG.md) for previous changes.
161
+ Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionview/CHANGELOG.md) for previous changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2022 David Heinemeier Hansson
1
+ Copyright (c) 2004-2021 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
@@ -18,3 +18,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
18
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
19
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
20
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
@@ -9,7 +9,7 @@ require "action_view/context"
9
9
  require "action_view/template"
10
10
  require "action_view/lookup_context"
11
11
 
12
- module ActionView #:nodoc:
12
+ module ActionView # :nodoc:
13
13
  # = Action View Base
14
14
  #
15
15
  # Action View templates can be written in several ways.
@@ -179,7 +179,7 @@ module ActionView #:nodoc:
179
179
  ActionView::Resolver.caching = value
180
180
  end
181
181
 
182
- def xss_safe? #:nodoc:
182
+ def xss_safe? # :nodoc:
183
183
  true
184
184
  end
185
185
 
@@ -227,7 +227,7 @@ module ActionView #:nodoc:
227
227
 
228
228
  # :startdoc:
229
229
 
230
- def initialize(lookup_context, assigns, controller) #:nodoc:
230
+ def initialize(lookup_context, assigns, controller) # :nodoc:
231
231
  @_config = ActiveSupport::InheritableOptions.new
232
232
 
233
233
  @lookup_context = lookup_context
@@ -18,7 +18,7 @@ module ActionView
18
18
  # sbuf << 5
19
19
  # puts sbuf # => "hello\u0005"
20
20
  #
21
- class OutputBuffer < ActiveSupport::SafeBuffer #:nodoc:
21
+ class OutputBuffer < ActiveSupport::SafeBuffer # :nodoc:
22
22
  def initialize(*)
23
23
  super
24
24
  encode!
@@ -38,7 +38,7 @@ module ActionView
38
38
  alias :safe_append= :safe_concat
39
39
  end
40
40
 
41
- class StreamingBuffer #:nodoc:
41
+ class StreamingBuffer # :nodoc:
42
42
  def initialize(block)
43
43
  @block = block
44
44
  end