actionview 6.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +169 -162
- data/MIT-LICENSE +1 -1
- data/README.rdoc +1 -1
- data/lib/action_view/base.rb +21 -52
- data/lib/action_view/cache_expiry.rb +1 -3
- data/lib/action_view/context.rb +0 -1
- data/lib/action_view/dependency_tracker.rb +10 -4
- data/lib/action_view/digestor.rb +3 -2
- data/lib/action_view/flows.rb +0 -1
- data/lib/action_view/gem_version.rb +1 -1
- data/lib/action_view/helpers/active_model_helper.rb +0 -1
- data/lib/action_view/helpers/asset_tag_helper.rb +41 -16
- data/lib/action_view/helpers/asset_url_helper.rb +6 -4
- data/lib/action_view/helpers/atom_feed_helper.rb +2 -1
- data/lib/action_view/helpers/cache_helper.rb +11 -18
- data/lib/action_view/helpers/date_helper.rb +5 -6
- data/lib/action_view/helpers/form_helper.rb +61 -19
- data/lib/action_view/helpers/form_options_helper.rb +7 -16
- data/lib/action_view/helpers/form_tag_helper.rb +9 -7
- data/lib/action_view/helpers/javascript_helper.rb +7 -5
- data/lib/action_view/helpers/number_helper.rb +9 -8
- data/lib/action_view/helpers/rendering_helper.rb +11 -3
- data/lib/action_view/helpers/sanitize_helper.rb +2 -2
- data/lib/action_view/helpers/tag_helper.rb +94 -19
- data/lib/action_view/helpers/tags/base.rb +9 -6
- data/lib/action_view/helpers/tags/check_box.rb +0 -1
- data/lib/action_view/helpers/tags/collection_check_boxes.rb +0 -1
- data/lib/action_view/helpers/tags/collection_helpers.rb +0 -1
- data/lib/action_view/helpers/tags/collection_radio_buttons.rb +0 -1
- data/lib/action_view/helpers/tags/color_field.rb +0 -1
- data/lib/action_view/helpers/tags/date_field.rb +1 -2
- data/lib/action_view/helpers/tags/date_select.rb +2 -3
- data/lib/action_view/helpers/tags/datetime_field.rb +0 -1
- data/lib/action_view/helpers/tags/datetime_local_field.rb +1 -2
- data/lib/action_view/helpers/tags/label.rb +4 -1
- data/lib/action_view/helpers/tags/month_field.rb +1 -2
- data/lib/action_view/helpers/tags/radio_button.rb +0 -1
- data/lib/action_view/helpers/tags/select.rb +1 -2
- data/lib/action_view/helpers/tags/text_field.rb +0 -1
- data/lib/action_view/helpers/tags/time_field.rb +1 -2
- data/lib/action_view/helpers/tags/week_field.rb +1 -2
- data/lib/action_view/helpers/text_helper.rb +1 -2
- data/lib/action_view/helpers/translation_helper.rb +98 -53
- data/lib/action_view/helpers/url_helper.rb +107 -13
- data/lib/action_view/layouts.rb +3 -5
- data/lib/action_view/log_subscriber.rb +26 -11
- data/lib/action_view/lookup_context.rb +7 -21
- data/lib/action_view/path_set.rb +0 -4
- data/lib/action_view/railtie.rb +35 -46
- data/lib/action_view/record_identifier.rb +0 -1
- data/lib/action_view/renderer/abstract_renderer.rb +92 -14
- data/lib/action_view/renderer/collection_renderer.rb +192 -0
- data/lib/action_view/renderer/object_renderer.rb +34 -0
- data/lib/action_view/renderer/partial_renderer/collection_caching.rb +25 -26
- data/lib/action_view/renderer/partial_renderer.rb +20 -283
- data/lib/action_view/renderer/renderer.rb +44 -1
- data/lib/action_view/renderer/streaming_template_renderer.rb +5 -3
- data/lib/action_view/renderer/template_renderer.rb +16 -14
- data/lib/action_view/rendering.rb +3 -2
- data/lib/action_view/routing_url_for.rb +1 -1
- data/lib/action_view/template/error.rb +9 -14
- data/lib/action_view/template/handlers/erb/erubi.rb +9 -7
- data/lib/action_view/template/handlers/erb.rb +10 -15
- data/lib/action_view/template/handlers.rb +0 -26
- data/lib/action_view/template/html.rb +1 -11
- data/lib/action_view/template/raw_file.rb +0 -3
- data/lib/action_view/template/renderable.rb +24 -0
- data/lib/action_view/template/resolver.rb +83 -45
- data/lib/action_view/template/text.rb +0 -3
- data/lib/action_view/template.rb +9 -50
- data/lib/action_view/test_case.rb +20 -28
- data/lib/action_view/testing/resolvers.rb +10 -32
- data/lib/action_view/unbound_template.rb +4 -5
- data/lib/action_view/view_paths.rb +34 -37
- data/lib/action_view.rb +5 -1
- data/lib/assets/compiled/rails-ujs.js +3 -3
- metadata +17 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 66b9ba4747ae5973f8f784343f64e7201d2bbf8299cb9b9dc2ed7869db55cbc6
|
|
4
|
+
data.tar.gz: da671bc8666ecd9386fa75a7639c837492df9b0d5b81c9f2a66114a522d6dec9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 409ff7a86026884f20e3fbf1eb0560fc990328369c15e90500f27dc8336020edc59acfb3b8da61806c7eac62ae501c1c5f176c4dc7da641f3da338bcfb2cc6f5
|
|
7
|
+
data.tar.gz: 961932d31d4e46c9674a9ea3229db468dfd922c1b79c9f23403b928763f1a8798848dae25554f09255965968109e7557953b4c3a7d6573e142061a3fc3e360c7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,271 +1,278 @@
|
|
|
1
|
-
## Rails 6.
|
|
1
|
+
## Rails 6.1.0 (December 09, 2020) ##
|
|
2
2
|
|
|
3
|
-
*
|
|
3
|
+
* SanitizeHelper.sanitized_allowed_attributes and SanitizeHelper.sanitized_allowed_tags
|
|
4
|
+
call safe_list_sanitizer's class method
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
Fixes #39586
|
|
6
7
|
|
|
8
|
+
*Taufiq Muhammadi*
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
* Change form_with to generate non-remote forms by default.
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
`form_with` would generate a remote form by default. This would confuse
|
|
13
|
+
users because they were forced to handle remote requests.
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
All new 6.1 applications will generate non-remote forms by default.
|
|
16
|
+
When upgrading a 6.0 application you can enable remote forms by default by
|
|
17
|
+
setting `config.action_view.form_with_generates_remote_forms` to `true`.
|
|
13
18
|
|
|
19
|
+
*Petrik de Heus*
|
|
14
20
|
|
|
15
|
-
|
|
21
|
+
* Yield translated strings to calls of `ActionView::FormBuilder#button`
|
|
22
|
+
when a block is given.
|
|
16
23
|
|
|
17
|
-
*
|
|
24
|
+
*Sean Doyle*
|
|
18
25
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
only renders the first one when `cached` is set to true. But it should render all
|
|
22
|
-
5 items instead.
|
|
26
|
+
* Alias `ActionView::Helpers::Tags::Label::LabelBuilder#translation` to
|
|
27
|
+
`#to_s` so that `form.label` calls can yield that value to their blocks.
|
|
23
28
|
|
|
24
|
-
|
|
29
|
+
*Sean Doyle*
|
|
25
30
|
|
|
26
|
-
|
|
31
|
+
* Rename the new `TagHelper#class_names` method to `TagHelper#token_list`,
|
|
32
|
+
and make the original available as an alias.
|
|
27
33
|
|
|
28
|
-
|
|
34
|
+
token_list("foo", "foo bar")
|
|
35
|
+
# => "foo bar"
|
|
29
36
|
|
|
30
|
-
|
|
31
|
-
the view paths have changed. Applications which have implemented custom
|
|
32
|
-
`ActionView::Resolver` subclasses may need to add their own cache clearing.
|
|
37
|
+
*Sean Doyle*
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
* ARIA Array and Hash attributes are treated as space separated `DOMTokenList`
|
|
40
|
+
values. This is useful when declaring lists of label text identifiers in
|
|
41
|
+
`aria-labelledby` or `aria-describedby`.
|
|
35
42
|
|
|
36
|
-
|
|
43
|
+
tag.input type: 'checkbox', name: 'published', aria: {
|
|
44
|
+
invalid: @post.errors[:published].any?,
|
|
45
|
+
labelledby: ['published_context', 'published_label'],
|
|
46
|
+
describedby: { published_errors: @post.errors[:published].any? }
|
|
47
|
+
}
|
|
48
|
+
#=> <input
|
|
49
|
+
type="checkbox" name="published" aria-invalid="true"
|
|
50
|
+
aria-labelledby="published_context published_label"
|
|
51
|
+
aria-describedby="published_errors"
|
|
52
|
+
>
|
|
37
53
|
|
|
38
|
-
*
|
|
54
|
+
*Sean Doyle*
|
|
39
55
|
|
|
56
|
+
* Remove deprecated `escape_whitelist` from `ActionView::Template::Handlers::ERB`.
|
|
40
57
|
|
|
41
|
-
|
|
58
|
+
*Rafael Mendonça França*
|
|
42
59
|
|
|
43
|
-
*
|
|
60
|
+
* Remove deprecated `find_all_anywhere` from `ActionView::Resolver`.
|
|
44
61
|
|
|
45
|
-
|
|
46
|
-
arbitrary files on the target server or to perform a denial of service
|
|
47
|
-
attack.
|
|
62
|
+
*Rafael Mendonça França*
|
|
48
63
|
|
|
49
|
-
|
|
50
|
-
Fixes CVE-2019-5419
|
|
64
|
+
* Remove deprecated `formats` from `ActionView::Template::HTML`.
|
|
51
65
|
|
|
52
|
-
*
|
|
66
|
+
*Rafael Mendonça França*
|
|
53
67
|
|
|
68
|
+
* Remove deprecated `formats` from `ActionView::Template::RawFile`.
|
|
54
69
|
|
|
55
|
-
|
|
70
|
+
*Rafael Mendonça França*
|
|
56
71
|
|
|
57
|
-
* `ActionView::Template
|
|
58
|
-
no replacement.
|
|
72
|
+
* Remove deprecated `formats` from `ActionView::Template::Text`.
|
|
59
73
|
|
|
60
|
-
*
|
|
74
|
+
*Rafael Mendonça França*
|
|
61
75
|
|
|
62
|
-
* `
|
|
63
|
-
no replacement.
|
|
76
|
+
* Remove deprecated `find_file` from `ActionView::PathSet`.
|
|
64
77
|
|
|
65
|
-
*
|
|
78
|
+
*Rafael Mendonça França*
|
|
66
79
|
|
|
67
|
-
*
|
|
80
|
+
* Remove deprecated `rendered_format` from `ActionView::LookupContext`.
|
|
68
81
|
|
|
69
|
-
|
|
82
|
+
*Rafael Mendonça França*
|
|
70
83
|
|
|
71
|
-
|
|
84
|
+
* Remove deprecated `find_file` from `ActionView::ViewPaths`.
|
|
72
85
|
|
|
86
|
+
*Rafael Mendonça França*
|
|
73
87
|
|
|
74
|
-
|
|
88
|
+
* Require that `ActionView::Base` subclasses implement `#compiled_method_container`.
|
|
75
89
|
|
|
76
|
-
*
|
|
77
|
-
|
|
78
|
-
|
|
90
|
+
*Rafael Mendonça França*
|
|
91
|
+
|
|
92
|
+
* Remove deprecated support to pass an object that is not a `ActionView::LookupContext` as the first argument
|
|
93
|
+
in `ActionView::Base#initialize`.
|
|
79
94
|
|
|
80
|
-
*
|
|
95
|
+
*Rafael Mendonça França*
|
|
81
96
|
|
|
82
|
-
* Remove deprecated `
|
|
97
|
+
* Remove deprecated `format` argument `ActionView::Base#initialize`.
|
|
83
98
|
|
|
84
99
|
*Rafael Mendonça França*
|
|
85
100
|
|
|
86
|
-
*
|
|
87
|
-
`ActionView::Base` subclasses. This prevents the use of forms and buttons.
|
|
101
|
+
* Remove deprecated `ActionView::Template#refresh`.
|
|
88
102
|
|
|
89
|
-
*
|
|
103
|
+
*Rafael Mendonça França*
|
|
90
104
|
|
|
91
|
-
*
|
|
105
|
+
* Remove deprecated `ActionView::Template#original_encoding`.
|
|
92
106
|
|
|
93
|
-
|
|
107
|
+
*Rafael Mendonça França*
|
|
94
108
|
|
|
95
|
-
|
|
109
|
+
* Remove deprecated `ActionView::Template#variants`.
|
|
96
110
|
|
|
97
|
-
*
|
|
98
|
-
Firefox fires click events even if the click was triggered by non-primary mouse keys such as right- or scroll-wheel-clicks.
|
|
99
|
-
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.
|
|
111
|
+
*Rafael Mendonça França*
|
|
100
112
|
|
|
101
|
-
|
|
102
|
-
<%= link_to 'Remote', remote_path, class: 'remote', remote: true, data: { type: :json } %>
|
|
103
|
-
```
|
|
113
|
+
* Remove deprecated `ActionView::Template#formats`.
|
|
104
114
|
|
|
105
|
-
|
|
115
|
+
*Rafael Mendonça França*
|
|
106
116
|
|
|
107
|
-
|
|
117
|
+
* Remove deprecated `ActionView::Template#virtual_path=`.
|
|
108
118
|
|
|
109
|
-
*
|
|
119
|
+
*Rafael Mendonça França*
|
|
110
120
|
|
|
111
|
-
|
|
121
|
+
* Remove deprecated `ActionView::Template#updated_at`.
|
|
112
122
|
|
|
113
|
-
|
|
114
|
-
This is a paragraph with an initial indent,
|
|
115
|
-
followed by additional lines that are not indented,
|
|
116
|
-
and finally terminated with a blockquote:
|
|
117
|
-
"A pithy saying"
|
|
118
|
-
```
|
|
123
|
+
*Rafael Mendonça França*
|
|
119
124
|
|
|
120
|
-
|
|
125
|
+
* Remove deprecated `updated_at` argument required on `ActionView::Template#initialize`.
|
|
121
126
|
|
|
122
|
-
|
|
127
|
+
*Rafael Mendonça França*
|
|
123
128
|
|
|
124
|
-
|
|
129
|
+
* Make `locals` argument required on `ActionView::Template#initialize`.
|
|
125
130
|
|
|
126
|
-
*
|
|
131
|
+
*Rafael Mendonça França*
|
|
127
132
|
|
|
128
|
-
|
|
133
|
+
* Remove deprecated `ActionView::Template.finalize_compiled_template_methods`.
|
|
129
134
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
+
*Rafael Mendonça França*
|
|
136
|
+
|
|
137
|
+
* Remove deprecated `config.action_view.finalize_compiled_template_methods`
|
|
138
|
+
|
|
139
|
+
*Rafael Mendonça França*
|
|
140
|
+
|
|
141
|
+
* Remove deprecated support to calling `ActionView::ViewPaths#with_fallback` with a block.
|
|
142
|
+
|
|
143
|
+
*Rafael Mendonça França*
|
|
135
144
|
|
|
136
|
-
|
|
145
|
+
* Remove deprecated support to passing absolute paths to `render template:`.
|
|
137
146
|
|
|
138
|
-
*
|
|
147
|
+
*Rafael Mendonça França*
|
|
139
148
|
|
|
140
|
-
|
|
149
|
+
* Remove deprecated support to passing relative paths to `render file:`.
|
|
141
150
|
|
|
142
|
-
*
|
|
151
|
+
*Rafael Mendonça França*
|
|
143
152
|
|
|
144
|
-
*
|
|
153
|
+
* Remove support to template handlers that don't accept two arguments.
|
|
145
154
|
|
|
146
|
-
|
|
147
|
-
and `collection_select` it is possible to call private methods from
|
|
148
|
-
the objects used.
|
|
155
|
+
*Rafael Mendonça França*
|
|
149
156
|
|
|
150
|
-
|
|
157
|
+
* Remove deprecated pattern argument in `ActionView::Template::PathResolver`.
|
|
151
158
|
|
|
152
|
-
*
|
|
159
|
+
*Rafael Mendonça França*
|
|
153
160
|
|
|
154
|
-
*
|
|
161
|
+
* Remove deprecated support to call private methods from object in some view helpers.
|
|
155
162
|
|
|
156
|
-
|
|
157
|
-
contains symbol and string keys. The reason for the exception was that
|
|
158
|
-
`to_form_params` was comparing the given symbol and string keys.
|
|
163
|
+
*Rafael Mendonça França*
|
|
159
164
|
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
* `ActionView::Helpers::TranslationHelper#translate` accepts a block, yielding
|
|
166
|
+
the translated text and the fully resolved translation key:
|
|
162
167
|
|
|
163
|
-
|
|
168
|
+
<%= translate(".relative_key") do |translation, resolved_key| %>
|
|
169
|
+
<span title="<%= resolved_key %>"><%= translation %></span>
|
|
170
|
+
<% end %>
|
|
164
171
|
|
|
165
|
-
*
|
|
172
|
+
*Sean Doyle*
|
|
166
173
|
|
|
167
|
-
|
|
174
|
+
* Ensure cache fragment digests include all relevant template dependencies when
|
|
175
|
+
fragments are contained in a block passed to the render helper. Remove the
|
|
176
|
+
virtual_path keyword arguments found in CacheHelper as they no longer possess
|
|
177
|
+
any function following 1581cab.
|
|
168
178
|
|
|
169
|
-
|
|
170
|
-
foo_html:
|
|
171
|
-
- "One"
|
|
172
|
-
- "<strong>Two</strong>"
|
|
173
|
-
- "Three 👋 🙂"
|
|
179
|
+
Fixes #38984.
|
|
174
180
|
|
|
175
|
-
*
|
|
181
|
+
*Aaron Lipman*
|
|
176
182
|
|
|
177
|
-
*
|
|
178
|
-
|
|
183
|
+
* Deprecate `config.action_view.raise_on_missing_translations` in favor of
|
|
184
|
+
`config.i18n.raise_on_missing_translations`.
|
|
179
185
|
|
|
180
|
-
|
|
186
|
+
New generalized configuration option now determines whether an error should be raised
|
|
187
|
+
for missing translations in controllers and views.
|
|
181
188
|
|
|
182
|
-
|
|
189
|
+
*fatkodima*
|
|
183
190
|
|
|
184
|
-
|
|
191
|
+
* Instrument layout rendering in `TemplateRenderer#render_with_layout` as `render_layout.action_view`,
|
|
192
|
+
and include (when necessary) the layout's virtual path in notification payloads for collection and partial renders.
|
|
185
193
|
|
|
186
|
-
|
|
187
|
-
<option value="1998">Heisei 10</option>
|
|
188
|
-
<option value="1999">Heisei 11</option>
|
|
189
|
-
<option value="2000">Heisei 12</option>
|
|
190
|
-
</select>
|
|
191
|
-
/* The rest is omitted */
|
|
194
|
+
*Zach Kemp*
|
|
192
195
|
|
|
193
|
-
|
|
196
|
+
* `ActionView::Base.annotate_rendered_view_with_filenames` annotates HTML output with template file names.
|
|
194
197
|
|
|
195
|
-
*
|
|
196
|
-
Content Security Policy.
|
|
198
|
+
*Joel Hawksley*, *Aaron Patterson*
|
|
197
199
|
|
|
198
|
-
|
|
200
|
+
* `ActionView::Helpers::TranslationHelper#translate` returns nil when
|
|
201
|
+
passed `default: nil` without a translation matching `I18n#translate`.
|
|
199
202
|
|
|
200
|
-
*
|
|
203
|
+
*Stefan Wrobel*
|
|
201
204
|
|
|
202
|
-
*
|
|
203
|
-
|
|
204
|
-
Works the same way as `javascript_tag nonce: true` does.
|
|
205
|
+
* `OptimizedFileSystemResolver` prefers template details in order of locale,
|
|
206
|
+
formats, variants, handlers.
|
|
205
207
|
|
|
206
|
-
*
|
|
208
|
+
*Iago Pimenta*
|
|
207
209
|
|
|
208
|
-
*
|
|
210
|
+
* Added `class_names` helper to create a CSS class value with conditional classes.
|
|
209
211
|
|
|
210
|
-
*
|
|
212
|
+
*Joel Hawksley*, *Aaron Patterson*
|
|
211
213
|
|
|
212
|
-
*
|
|
214
|
+
* Add support for conditional values to TagBuilder.
|
|
213
215
|
|
|
214
|
-
|
|
215
|
-
Add a configuration option,
|
|
216
|
-
`action_view.finalize_compiled_template_methods`, and turn it off in
|
|
217
|
-
the test environment.
|
|
216
|
+
*Joel Hawksley*
|
|
218
217
|
|
|
219
|
-
|
|
218
|
+
* `ActionView::Helpers::FormOptionsHelper#select` should mark option for `nil` as selected.
|
|
220
219
|
|
|
221
|
-
|
|
220
|
+
```ruby
|
|
221
|
+
@post = Post.new
|
|
222
|
+
@post.category = nil
|
|
222
223
|
|
|
223
|
-
|
|
224
|
+
# Before
|
|
225
|
+
select("post", "category", none: nil, programming: 1, economics: 2)
|
|
226
|
+
# =>
|
|
227
|
+
# <select name="post[category]" id="post_category">
|
|
228
|
+
# <option value="">none</option>
|
|
229
|
+
# <option value="1">programming</option>
|
|
230
|
+
# <option value="2">economics</option>
|
|
231
|
+
# </select>
|
|
224
232
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
233
|
+
# After
|
|
234
|
+
select("post", "category", none: nil, programming: 1, economics: 2)
|
|
235
|
+
# =>
|
|
236
|
+
# <select name="post[category]" id="post_category">
|
|
237
|
+
# <option selected="selected" value="">none</option>
|
|
238
|
+
# <option value="1">programming</option>
|
|
239
|
+
# <option value="2">economics</option>
|
|
240
|
+
# </select>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
*bogdanvlviv*
|
|
228
244
|
|
|
229
|
-
|
|
245
|
+
* Log lines for partial renders and started template renders are now
|
|
246
|
+
emitted at the `DEBUG` level instead of `INFO`.
|
|
230
247
|
|
|
231
|
-
|
|
232
|
-
field.
|
|
248
|
+
Completed template renders are still logged at the `INFO` level.
|
|
233
249
|
|
|
234
|
-
|
|
250
|
+
*DHH*
|
|
235
251
|
|
|
236
|
-
|
|
237
|
-
:category,
|
|
238
|
-
["lifestyle", "programming", "spiritual"],
|
|
239
|
-
{ selected: "", disabled: "", prompt: "Choose one" },
|
|
240
|
-
{ required: true }
|
|
252
|
+
* ActionView::Helpers::SanitizeHelper: support rails-html-sanitizer 1.1.0.
|
|
241
253
|
|
|
242
|
-
|
|
254
|
+
*Juanito Fatas*
|
|
243
255
|
|
|
244
|
-
|
|
256
|
+
* Added `phone_to` helper method to create a link from mobile numbers.
|
|
245
257
|
|
|
246
|
-
|
|
247
|
-
<option disabled="disabled" selected="selected" value="">Choose one</option>
|
|
248
|
-
<option value="lifestyle">lifestyle</option>
|
|
249
|
-
<option value="programming">programming</option>
|
|
250
|
-
<option value="spiritual">spiritual</option></select>
|
|
258
|
+
*Pietro Moro*
|
|
251
259
|
|
|
252
|
-
|
|
260
|
+
* annotated_source_code returns an empty array so TemplateErrors without a
|
|
261
|
+
template in the backtrace are surfaced properly by DebugExceptions.
|
|
253
262
|
|
|
254
|
-
*
|
|
263
|
+
*Guilherme Mansur*, *Kasper Timm Hansen*
|
|
255
264
|
|
|
256
|
-
|
|
257
|
-
IE8 or lower becomes increasingly difficult so default to not enforcing
|
|
258
|
-
UTF-8 encoding as it's not relevant to other browsers.
|
|
265
|
+
* Add autoload for SyntaxErrorInTemplate so syntax errors are correctly raised by DebugExceptions.
|
|
259
266
|
|
|
260
|
-
*
|
|
267
|
+
*Guilherme Mansur*, *Gannon McGibbon*
|
|
261
268
|
|
|
262
|
-
*
|
|
269
|
+
* `RenderingHelper` supports rendering objects that `respond_to?` `:render_in`.
|
|
263
270
|
|
|
264
|
-
*
|
|
271
|
+
*Joel Hawksley*, *Natasha Umer*, *Aaron Patterson*, *Shawn Allen*, *Emily Plummer*, *Diana Mounter*, *John Hawthorn*, *Nathan Herald*, *Zaid Zawaideh*, *Zach Ahn*
|
|
265
272
|
|
|
266
|
-
*
|
|
273
|
+
* Fix `select_tag` so that it doesn't change `options` when `include_blank` is present.
|
|
267
274
|
|
|
268
|
-
*
|
|
275
|
+
*Younes SERRAJ*
|
|
269
276
|
|
|
270
277
|
|
|
271
|
-
Please check [
|
|
278
|
+
Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actionview/CHANGELOG.md) for previous changes.
|
data/MIT-LICENSE
CHANGED
data/README.rdoc
CHANGED
|
@@ -37,4 +37,4 @@ Bug reports for the Ruby on Rails project can be filed here:
|
|
|
37
37
|
|
|
38
38
|
Feature requests should be discussed on the rails-core mailing list here:
|
|
39
39
|
|
|
40
|
-
* https://
|
|
40
|
+
* https://discuss.rubyonrails.org/c/rubyonrails-core
|
data/lib/action_view/base.rb
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
require "active_support/core_ext/module/attr_internal"
|
|
4
4
|
require "active_support/core_ext/module/attribute_accessors"
|
|
5
5
|
require "active_support/ordered_options"
|
|
6
|
-
require "active_support/deprecation"
|
|
7
6
|
require "action_view/log_subscriber"
|
|
8
7
|
require "action_view/helpers"
|
|
9
8
|
require "action_view/context"
|
|
@@ -28,7 +27,7 @@ module ActionView #:nodoc:
|
|
|
28
27
|
# Name: <%= person.name %><br/>
|
|
29
28
|
# <% end %>
|
|
30
29
|
#
|
|
31
|
-
# The loop is
|
|
30
|
+
# The loop is set up in regular embedding tags <tt><% %></tt>, and the name is written using the output embedding tag <tt><%= %></tt>. Note that this
|
|
32
31
|
# is not just a usage suggestion. Regular output functions like print or puts won't work with ERB templates. So this would be wrong:
|
|
33
32
|
#
|
|
34
33
|
# <%# WRONG %>
|
|
@@ -152,7 +151,7 @@ module ActionView #:nodoc:
|
|
|
152
151
|
# Specify whether rendering within namespaced controllers should prefix
|
|
153
152
|
# the partial paths for ActiveModel objects with the namespace.
|
|
154
153
|
# (e.g., an Admin::PostsController would render @post using /admin/posts/_post.erb)
|
|
155
|
-
|
|
154
|
+
class_attribute :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
|
|
@@ -163,6 +162,9 @@ module ActionView #:nodoc:
|
|
|
163
162
|
# Specify whether submit_tag should automatically disable on click
|
|
164
163
|
cattr_accessor :automatically_disable_submit_tag, default: true
|
|
165
164
|
|
|
165
|
+
# Annotate rendered view with file names
|
|
166
|
+
cattr_accessor :annotate_rendered_view_with_filenames, default: false
|
|
167
|
+
|
|
166
168
|
class_attribute :_routes
|
|
167
169
|
class_attribute :logger
|
|
168
170
|
|
|
@@ -188,6 +190,10 @@ module ActionView #:nodoc:
|
|
|
188
190
|
# correctly.
|
|
189
191
|
define_method(:compiled_method_container) { subclass }
|
|
190
192
|
define_singleton_method(:compiled_method_container) { subclass }
|
|
193
|
+
|
|
194
|
+
def inspect
|
|
195
|
+
"#<ActionView::Base:#{'%#016x' % (object_id << 1)}>"
|
|
196
|
+
end
|
|
191
197
|
}
|
|
192
198
|
end
|
|
193
199
|
|
|
@@ -207,21 +213,6 @@ module ActionView #:nodoc:
|
|
|
207
213
|
|
|
208
214
|
# :stopdoc:
|
|
209
215
|
|
|
210
|
-
def self.build_lookup_context(context)
|
|
211
|
-
case context
|
|
212
|
-
when ActionView::Renderer
|
|
213
|
-
context.lookup_context
|
|
214
|
-
when Array
|
|
215
|
-
ActionView::LookupContext.new(context)
|
|
216
|
-
when ActionView::PathSet
|
|
217
|
-
ActionView::LookupContext.new(context)
|
|
218
|
-
when nil
|
|
219
|
-
ActionView::LookupContext.new([])
|
|
220
|
-
else
|
|
221
|
-
raise NotImplementedError, context.class.name
|
|
222
|
-
end
|
|
223
|
-
end
|
|
224
|
-
|
|
225
216
|
def self.empty
|
|
226
217
|
with_view_paths([])
|
|
227
218
|
end
|
|
@@ -234,58 +225,36 @@ module ActionView #:nodoc:
|
|
|
234
225
|
new context, assigns, controller
|
|
235
226
|
end
|
|
236
227
|
|
|
237
|
-
NULL = Object.new
|
|
238
|
-
|
|
239
228
|
# :startdoc:
|
|
240
229
|
|
|
241
|
-
def initialize(lookup_context
|
|
230
|
+
def initialize(lookup_context, assigns, controller) #:nodoc:
|
|
242
231
|
@_config = ActiveSupport::InheritableOptions.new
|
|
243
232
|
|
|
244
|
-
|
|
245
|
-
ActiveSupport::Deprecation.warn <<~eowarn.squish
|
|
246
|
-
Passing formats to ActionView::Base.new is deprecated
|
|
247
|
-
eowarn
|
|
248
|
-
end
|
|
249
|
-
|
|
250
|
-
case lookup_context
|
|
251
|
-
when ActionView::LookupContext
|
|
252
|
-
@lookup_context = lookup_context
|
|
253
|
-
else
|
|
254
|
-
ActiveSupport::Deprecation.warn <<~eowarn.squish
|
|
255
|
-
ActionView::Base instances should be constructed with a lookup context,
|
|
256
|
-
assignments, and a controller.
|
|
257
|
-
eowarn
|
|
258
|
-
@lookup_context = self.class.build_lookup_context(lookup_context)
|
|
259
|
-
end
|
|
233
|
+
@lookup_context = lookup_context
|
|
260
234
|
|
|
261
235
|
@view_renderer = ActionView::Renderer.new @lookup_context
|
|
262
236
|
@current_template = nil
|
|
263
237
|
|
|
264
|
-
@cache_hit = {}
|
|
265
238
|
assign(assigns)
|
|
266
239
|
assign_controller(controller)
|
|
267
240
|
_prepare_context
|
|
268
241
|
end
|
|
269
242
|
|
|
270
|
-
def _run(method, template, locals, buffer, &block)
|
|
271
|
-
_old_output_buffer,
|
|
272
|
-
@current_template = template
|
|
243
|
+
def _run(method, template, locals, buffer, add_to_stack: true, &block)
|
|
244
|
+
_old_output_buffer, _old_template = @output_buffer, @current_template
|
|
245
|
+
@current_template = template if add_to_stack
|
|
273
246
|
@output_buffer = buffer
|
|
274
|
-
|
|
247
|
+
public_send(method, locals, buffer, &block)
|
|
275
248
|
ensure
|
|
276
|
-
@output_buffer, @
|
|
249
|
+
@output_buffer, @current_template = _old_output_buffer, _old_template
|
|
277
250
|
end
|
|
278
251
|
|
|
279
252
|
def compiled_method_container
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
eowarn
|
|
286
|
-
end
|
|
287
|
-
|
|
288
|
-
self.class
|
|
253
|
+
raise NotImplementedError, <<~msg.squish
|
|
254
|
+
Subclasses of ActionView::Base must implement `compiled_method_container`
|
|
255
|
+
or use the class method `with_empty_template_cache` for constructing
|
|
256
|
+
an ActionView::Base subclass that has an empty cache.
|
|
257
|
+
msg
|
|
289
258
|
end
|
|
290
259
|
|
|
291
260
|
def in_rendering_context(options)
|
|
@@ -41,10 +41,8 @@ module ActionView
|
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
private
|
|
44
|
-
|
|
45
44
|
def dirs_to_watch
|
|
46
|
-
|
|
47
|
-
fs_paths.map(&:path).sort.uniq
|
|
45
|
+
all_view_paths.grep(FileSystemResolver).map!(&:path).tap(&:uniq!).sort!
|
|
48
46
|
end
|
|
49
47
|
|
|
50
48
|
def all_view_paths
|