actionview 5.0.7.2 → 5.1.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionview might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +169 -345
- data/MIT-LICENSE +1 -1
- data/README.rdoc +1 -1
- data/lib/action_view/base.rb +19 -19
- data/lib/action_view/buffers.rb +1 -1
- data/lib/action_view/context.rb +1 -1
- data/lib/action_view/dependency_tracker.rb +4 -5
- data/lib/action_view/digestor.rb +22 -13
- data/lib/action_view/flows.rb +5 -6
- data/lib/action_view/gem_version.rb +2 -2
- data/lib/action_view/helpers/active_model_helper.rb +8 -8
- data/lib/action_view/helpers/asset_tag_helper.rb +62 -36
- data/lib/action_view/helpers/asset_url_helper.rb +111 -49
- data/lib/action_view/helpers/atom_feed_helper.rb +12 -13
- data/lib/action_view/helpers/cache_helper.rb +32 -20
- data/lib/action_view/helpers/capture_helper.rb +2 -2
- data/lib/action_view/helpers/controller_helper.rb +2 -2
- data/lib/action_view/helpers/csrf_helper.rb +3 -3
- data/lib/action_view/helpers/date_helper.rb +119 -109
- data/lib/action_view/helpers/debug_helper.rb +2 -3
- data/lib/action_view/helpers/form_helper.rb +440 -31
- data/lib/action_view/helpers/form_options_helper.rb +12 -12
- data/lib/action_view/helpers/form_tag_helper.rb +20 -19
- data/lib/action_view/helpers/javascript_helper.rb +6 -6
- data/lib/action_view/helpers/number_helper.rb +48 -46
- data/lib/action_view/helpers/output_safety_helper.rb +8 -8
- data/lib/action_view/helpers/record_tag_helper.rb +2 -2
- data/lib/action_view/helpers/rendering_helper.rb +2 -3
- data/lib/action_view/helpers/sanitize_helper.rb +16 -12
- data/lib/action_view/helpers/tag_helper.rb +194 -77
- data/lib/action_view/helpers/tags/base.rb +121 -102
- data/lib/action_view/helpers/tags/check_box.rb +17 -17
- data/lib/action_view/helpers/tags/collection_check_boxes.rb +9 -8
- data/lib/action_view/helpers/tags/collection_helpers.rb +60 -60
- data/lib/action_view/helpers/tags/collection_radio_buttons.rb +3 -2
- data/lib/action_view/helpers/tags/collection_select.rb +2 -2
- data/lib/action_view/helpers/tags/date_select.rb +36 -36
- data/lib/action_view/helpers/tags/grouped_collection_select.rb +2 -2
- data/lib/action_view/helpers/tags/label.rb +4 -0
- data/lib/action_view/helpers/tags/password_field.rb +1 -1
- data/lib/action_view/helpers/tags/radio_button.rb +4 -4
- data/lib/action_view/helpers/tags/select.rb +9 -9
- data/lib/action_view/helpers/tags/text_area.rb +1 -1
- data/lib/action_view/helpers/tags/text_field.rb +5 -5
- data/lib/action_view/helpers/tags/translator.rb +14 -12
- data/lib/action_view/helpers/text_helper.rb +20 -19
- data/lib/action_view/helpers/translation_helper.rb +6 -6
- data/lib/action_view/helpers/url_helper.rb +48 -46
- data/lib/action_view/helpers.rb +1 -1
- data/lib/action_view/layouts.rb +51 -47
- data/lib/action_view/log_subscriber.rb +25 -9
- data/lib/action_view/lookup_context.rb +19 -25
- data/lib/action_view/path_set.rb +19 -19
- data/lib/action_view/railtie.rb +13 -4
- data/lib/action_view/record_identifier.rb +6 -6
- data/lib/action_view/renderer/abstract_renderer.rb +17 -17
- data/lib/action_view/renderer/partial_renderer/collection_caching.rb +7 -1
- data/lib/action_view/renderer/partial_renderer.rb +188 -187
- data/lib/action_view/renderer/renderer.rb +4 -0
- data/lib/action_view/renderer/streaming_template_renderer.rb +45 -47
- data/lib/action_view/renderer/template_renderer.rb +64 -66
- data/lib/action_view/rendering.rb +4 -5
- data/lib/action_view/routing_url_for.rb +9 -13
- data/lib/action_view/tasks/cache_digests.rake +7 -7
- data/lib/action_view/template/error.rb +5 -15
- data/lib/action_view/template/handlers/builder.rb +7 -7
- data/lib/action_view/template/handlers/erb/deprecated_erubis.rb +9 -0
- data/lib/action_view/template/handlers/erb/erubi.rb +81 -0
- data/lib/action_view/template/handlers/erb/erubis.rb +81 -0
- data/lib/action_view/template/handlers/erb.rb +9 -76
- data/lib/action_view/template/handlers.rb +4 -4
- data/lib/action_view/template/html.rb +2 -4
- data/lib/action_view/template/resolver.rb +107 -90
- data/lib/action_view/template/text.rb +5 -8
- data/lib/action_view/template/types.rb +1 -1
- data/lib/action_view/template.rb +26 -27
- data/lib/action_view/test_case.rb +20 -21
- data/lib/action_view/testing/resolvers.rb +29 -30
- data/lib/action_view/version.rb +1 -1
- data/lib/action_view/view_paths.rb +20 -8
- data/lib/action_view.rb +5 -5
- data/lib/assets/compiled/rails-ujs.js +683 -0
- metadata +18 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 653bc5c6f534a3b66e9bc0517e1dae96591c0afc046eb4af21c2bfde0aa5436d
|
4
|
+
data.tar.gz: 3f6ac20820ff6a4d61dcf499bff23acf931f3a6ea65822720f63e0e522f1b77d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c21cc5b6ec4a492a753325d9c732c9c8900ef7e07134bc259becbd040df51afd0ff3bb27141bcd9ac87c02537eae789161e7e5241f4bfadd230a29aabc3a36fa
|
7
|
+
data.tar.gz: dcd3864b5a9216b19021272876564be5170b6d3e6af094a0a744517d01d89c58629156e6b4a87ebf593e37ae2478eb6687e9e923fe675d22d740e555ea91e64e
|
data/CHANGELOG.md
CHANGED
@@ -1,482 +1,306 @@
|
|
1
|
-
## Rails 5.
|
2
|
-
|
3
|
-
* No changes.
|
1
|
+
## Rails 5.1.7 (March 27, 2019) ##
|
4
2
|
|
3
|
+
* Fix issue with `button_to`'s `to_form_params`
|
5
4
|
|
6
|
-
|
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.
|
7
8
|
|
8
|
-
|
9
|
+
The issue is fixed by turning all keys to strings inside
|
10
|
+
`to_form_params` before comparing them.
|
9
11
|
|
12
|
+
*Georgi Georgiev*
|
10
13
|
|
11
|
-
## Rails 5.
|
14
|
+
## Rails 5.1.6.2 (March 11, 2019) ##
|
12
15
|
|
13
16
|
* No changes.
|
14
17
|
|
15
18
|
|
16
|
-
## Rails 5.
|
19
|
+
## Rails 5.1.6.1 (November 27, 2018) ##
|
17
20
|
|
18
21
|
* No changes.
|
19
22
|
|
20
23
|
|
21
|
-
## Rails 5.
|
24
|
+
## Rails 5.1.6 (March 29, 2018) ##
|
22
25
|
|
23
26
|
* No changes.
|
24
27
|
|
25
28
|
|
26
|
-
## Rails 5.
|
29
|
+
## Rails 5.1.5 (February 14, 2018) ##
|
27
30
|
|
28
31
|
* No changes.
|
29
32
|
|
30
33
|
|
31
|
-
## Rails 5.
|
34
|
+
## Rails 5.1.4 (September 07, 2017) ##
|
32
35
|
|
33
36
|
* No changes.
|
34
37
|
|
35
38
|
|
36
|
-
## Rails 5.
|
39
|
+
## Rails 5.1.4.rc1 (August 24, 2017) ##
|
37
40
|
|
38
41
|
* No changes.
|
39
42
|
|
40
43
|
|
41
|
-
## Rails 5.
|
44
|
+
## Rails 5.1.3 (August 03, 2017) ##
|
42
45
|
|
43
46
|
* No changes.
|
44
47
|
|
45
48
|
|
46
|
-
## Rails 5.
|
49
|
+
## Rails 5.1.3.rc3 (July 31, 2017) ##
|
47
50
|
|
48
51
|
* No changes.
|
49
52
|
|
50
53
|
|
51
|
-
## Rails 5.
|
52
|
-
|
53
|
-
* Allow render locals to be assigned to instance variables in a view.
|
54
|
-
|
55
|
-
Fixes #27480.
|
56
|
-
|
57
|
-
*Andrew White*
|
58
|
-
|
59
|
-
* Return correct object name in form helper method after `fields_for`.
|
60
|
-
|
61
|
-
Fixes #26931.
|
54
|
+
## Rails 5.1.3.rc2 (July 25, 2017) ##
|
62
55
|
|
63
|
-
|
56
|
+
* No changes.
|
64
57
|
|
65
58
|
|
66
|
-
## Rails 5.
|
59
|
+
## Rails 5.1.3.rc1 (July 19, 2017) ##
|
67
60
|
|
68
61
|
* No changes.
|
69
62
|
|
70
63
|
|
71
|
-
## Rails 5.
|
64
|
+
## Rails 5.1.2 (June 26, 2017) ##
|
72
65
|
|
73
|
-
*
|
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`.
|
74
73
|
|
75
|
-
|
74
|
+
This makes sure that the labels are linked up with the fields.
|
76
75
|
|
77
|
-
|
76
|
+
Fixes #29014.
|
78
77
|
|
78
|
+
*Yuji Yaginuma*
|
79
79
|
|
80
|
-
|
80
|
+
* Update distance_of_time_in_words helper to display better error messages
|
81
|
+
for bad input.
|
81
82
|
|
82
|
-
*
|
83
|
+
*Jay Hayes*
|
83
84
|
|
84
|
-
*Jon Moss*
|
85
85
|
|
86
|
-
|
86
|
+
## Rails 5.1.1 (May 12, 2017) ##
|
87
87
|
|
88
|
-
|
89
|
-
will still be available in local_assigns.
|
88
|
+
* No changes.
|
90
89
|
|
91
|
-
Example of render with reserved words:
|
92
90
|
|
93
|
-
|
94
|
-
<%= render "example", class: "text-center", message: "Hello world!" %>
|
95
|
-
|
96
|
-
<!-- _example.html.erb: -->
|
97
|
-
<%= tag.div class: local_assigns[:class] do %>
|
98
|
-
<p><%= message %></p>
|
99
|
-
<% end %>
|
100
|
-
```
|
91
|
+
## Rails 5.1.0 (April 27, 2017) ##
|
101
92
|
|
102
|
-
|
93
|
+
* Remove the option `encode_special_chars` misnomer from `strip_tags`
|
103
94
|
|
104
|
-
|
105
|
-
|
95
|
+
As of rails-html-sanitizer v1.0.3, the sanitizer will ignore the
|
96
|
+
`encode_special_chars` option.
|
106
97
|
|
107
|
-
|
108
|
-
queries of ActiveRecord Relations by calling `#to_ary` on the given
|
109
|
-
collection. Instances of `Enumerator` or `Enumerable` are valid
|
110
|
-
collections, but they do not implement `#to_ary`. By changing this to
|
111
|
-
`#to_a`, they will now be extracted and rendered as expected.
|
98
|
+
Fixes #28060.
|
112
99
|
|
113
|
-
*
|
100
|
+
*Andrew Hood*
|
114
101
|
|
115
|
-
*
|
116
|
-
a trailing slash.
|
102
|
+
* Change the ERB handler from Erubis to Erubi.
|
117
103
|
|
118
|
-
|
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+.
|
119
106
|
|
120
|
-
|
107
|
+
Compatibility: Drops support for `<%===` tags for debug output.
|
108
|
+
These were an unused, undocumented side effect of the Erubis
|
109
|
+
implementation.
|
121
110
|
|
111
|
+
Deprecation: The Erubis handler will be removed in Rails 5.2, for the
|
112
|
+
handful of folks using it directly.
|
122
113
|
|
123
|
-
|
114
|
+
*Jeremy Evans*
|
124
115
|
|
125
|
-
*
|
126
|
-
implement `to_a`.
|
116
|
+
* Allow render locals to be assigned to instance variables in a view.
|
127
117
|
|
128
|
-
|
129
|
-
queries of ActiveRecord Relations by calling `#to_ary` on the given
|
130
|
-
collection. Instances of `Enumerator` or `Enumerable` are valid
|
131
|
-
collections, but they do not implement `#to_ary`. By changing this to
|
132
|
-
`#to_a`, they will now be extracted and rendered as expected.
|
118
|
+
Fixes #27480.
|
133
119
|
|
134
|
-
*
|
120
|
+
*Andrew White*
|
135
121
|
|
136
|
-
*
|
122
|
+
* Add `check_parameters` option to `current_page?` which makes it more strict.
|
137
123
|
|
138
|
-
|
139
|
-
and it is recomended to use `datetime-local`.
|
140
|
-
Ref: https://html.spec.whatwg.org/multipage/forms.html#local-date-and-time-state-(type=datetime-local)
|
124
|
+
*Maksym Pugach*
|
141
125
|
|
142
|
-
|
126
|
+
* Return correct object name in form helper method after `fields_for`.
|
143
127
|
|
144
|
-
|
145
|
-
HTML-safe strings.
|
128
|
+
Fixes #26931.
|
146
129
|
|
147
|
-
|
148
|
-
the ERB template handler escaped strings by default this broke some applications that
|
149
|
-
expected plain JS or HTML files to be rendered unescaped. This fixes the issue caused
|
150
|
-
by changing the default handler by changing the Raw template handler to output HTML-safe
|
151
|
-
strings.
|
130
|
+
*Yuji Yaginuma*
|
152
131
|
|
153
|
-
|
132
|
+
* Use `ActionView::Resolver.caching?` (`config.action_view.cache_template_loading`)
|
133
|
+
to enable template recompilation.
|
154
134
|
|
155
|
-
|
156
|
-
|
157
|
-
Ref: https://www.w3.org/TR/html5/forms.html#the-option-element.
|
135
|
+
Before it was enabled by `consider_all_requests_local`, which caused
|
136
|
+
recompilation in tests.
|
158
137
|
|
159
|
-
|
138
|
+
*Max Melentiev*
|
160
139
|
|
161
|
-
|
162
|
-
<option value=""></option>
|
163
|
-
```
|
140
|
+
* Add `form_with` to unify `form_tag` and `form_for` usage.
|
164
141
|
|
165
|
-
|
142
|
+
Used like `form_tag` (where just the open tag is output):
|
166
143
|
|
167
|
-
```
|
168
|
-
|
144
|
+
```erb
|
145
|
+
<%= form_with scope: :post, url: super_special_posts_path %>
|
169
146
|
```
|
170
147
|
|
171
|
-
|
172
|
-
|
173
|
-
* `date_select` helper `:with_css_classes` option now accepts a hash of strings
|
174
|
-
for `:year`, `:month`, `:day`, `:hour`, `:minute`, `:second` that will extend
|
175
|
-
the select type with the given css class value.
|
148
|
+
Used like `form_for`:
|
176
149
|
|
177
150
|
```erb
|
178
|
-
<%=
|
179
|
-
|
180
|
-
|
181
|
-
```html
|
182
|
-
<select id="user_birthday_3i" name="user[birthday(3i)]">…</select>
|
183
|
-
<select id="user_birthday_2i" name="user[birthday(2i)]" class="my-month">…</select>
|
184
|
-
<select id="user_birthday_1i" name="user[birthday(1i)]" class="my-year">…</select>
|
151
|
+
<%= form_with model: @post do |form| %>
|
152
|
+
<%= form.text_field :title %>
|
153
|
+
<% end %>
|
185
154
|
```
|
186
155
|
|
187
|
-
*
|
188
|
-
|
189
|
-
* Add `to_sentence` helper that is a HTML-safe aware version of `Array#to_sentence`.
|
156
|
+
*Kasper Timm Hansen*, *Marek Kirejczyk*
|
190
157
|
|
191
|
-
|
158
|
+
* Add `fields` form helper method.
|
192
159
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
*Vipul A M and Prem Sichanugrist*
|
198
|
-
|
199
|
-
* Collection rendering can cache and fetch multiple partials at once.
|
200
|
-
|
201
|
-
Collections rendered as:
|
202
|
-
|
203
|
-
```ruby
|
204
|
-
<%= render partial: 'notifications/notification', collection: @notifications, as: :notification, cached: true %>
|
205
|
-
```
|
206
|
-
|
207
|
-
will read several partials from cache at once. The templates in the collection
|
208
|
-
that haven't been cached already will automatically be written to cache. Works
|
209
|
-
great alongside individual template fragment caching. For instance if the
|
210
|
-
template the collection renders is cached like:
|
211
|
-
|
212
|
-
```ruby
|
213
|
-
# notifications/_notification.html.erb
|
214
|
-
<% cache notification do %>
|
215
|
-
<%# ... %>
|
160
|
+
```erb
|
161
|
+
<%= fields :comment, model: @comment do |fields| %>
|
162
|
+
<%= fields.text_field :title %>
|
216
163
|
<% end %>
|
217
164
|
```
|
218
165
|
|
219
|
-
|
220
|
-
ones at once.
|
166
|
+
Can also be used within form helpers such as `form_with`.
|
221
167
|
|
222
168
|
*Kasper Timm Hansen*
|
223
169
|
|
224
|
-
*
|
225
|
-
|
226
|
-
*James Coleman*
|
227
|
-
|
228
|
-
* Fix stripping the digest from the automatically generated img tag alt
|
229
|
-
attribute when assets are handled by Sprockets >=3.0.
|
230
|
-
|
231
|
-
*Bart de Water*
|
232
|
-
|
233
|
-
* Create a new `ActiveSupport::SafeBuffer` instance when `content_for` is flushed.
|
234
|
-
|
235
|
-
Fixes #19890.
|
236
|
-
|
237
|
-
*Yoong Kang Lim*
|
238
|
-
|
239
|
-
* Fix `collection_radio_buttons` hidden_field name and make it appear
|
240
|
-
before the actual input radio tags to make the real value override
|
241
|
-
the hidden when passed.
|
242
|
-
|
243
|
-
Fixes #22773.
|
244
|
-
|
245
|
-
*Santiago Pastorino*
|
246
|
-
|
247
|
-
* `ActionView::TestCase::Controller#params` returns an instance of
|
248
|
-
`ActionController::Parameters`.
|
249
|
-
|
250
|
-
*Justin Coyne*
|
251
|
-
|
252
|
-
* Fix regression in `submit_tag` when a symbol is used as label argument.
|
253
|
-
|
254
|
-
*Yuuji Yaginuma*
|
255
|
-
|
256
|
-
* `I18n.translate` helper will wrap the missing translation keys
|
257
|
-
in a <span> tag only if `debug_missing_translation` configuration
|
258
|
-
be true. Default value is `true`. For example in `application.rb`:
|
259
|
-
|
260
|
-
# in order to turn off missing key wrapping
|
261
|
-
config.action_view.debug_missing_translation = false
|
262
|
-
|
263
|
-
*Sameer Rahmani*
|
170
|
+
* Removed deprecated `#original_exception` in `ActionView::Template::Error`.
|
264
171
|
|
265
|
-
*
|
266
|
-
|
267
|
-
Fixes #22260.
|
268
|
-
|
269
|
-
*Yuichiro Kaneko*
|
270
|
-
|
271
|
-
* Generate `week_field` input values using a 1-based index and not a 0-based index
|
272
|
-
as per the W3 spec: http://www.w3.org/TR/html-markup/datatypes.html#form.data.week
|
273
|
-
|
274
|
-
*Christoph Geschwind*
|
275
|
-
|
276
|
-
* Allow `host` option in `javascript_include_tag` and `stylesheet_link_tag` helpers
|
277
|
-
|
278
|
-
*Grzegorz Witek*
|
279
|
-
|
280
|
-
* Restrict `url_for :back` to valid, non-JavaScript URLs. GH#14444
|
281
|
-
|
282
|
-
*Damien Burke*
|
283
|
-
|
284
|
-
* Allow `date_select` helper selected option to accept hash like the default options.
|
285
|
-
|
286
|
-
*Lecky Lao*
|
287
|
-
|
288
|
-
* Collection input propagates input's `id` to the label's `for` attribute when
|
289
|
-
using html options as the last element of collection.
|
290
|
-
|
291
|
-
*Vasiliy Ermolovich*
|
292
|
-
|
293
|
-
* Add a `hidden_field` on the `collection_radio_buttons` to avoid raising an error
|
294
|
-
when the only input on the form is the `collection_radio_buttons`.
|
295
|
-
|
296
|
-
*Mauro George*
|
297
|
-
|
298
|
-
* `url_for` does not modify its arguments when generating polymorphic URLs.
|
299
|
-
|
300
|
-
*Bernerd Schaefer*
|
301
|
-
|
302
|
-
* `number_to_currency` and `number_with_delimiter` now accept a custom `delimiter_pattern` option
|
303
|
-
to handle placement of delimiter, to support currency formats like INR.
|
304
|
-
|
305
|
-
Example:
|
306
|
-
|
307
|
-
number_to_currency(1230000, delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/, unit: '₹', format: "%u %n")
|
308
|
-
# => '₹ 12,30,000.00'
|
309
|
-
|
310
|
-
*Vipul A M*
|
311
|
-
|
312
|
-
* Make `disable_with` the default behavior for submit tags. Disables the
|
313
|
-
button on submit to prevent double submits.
|
314
|
-
|
315
|
-
*Justin Schiff*
|
316
|
-
|
317
|
-
* Add a break_sequence option to word_wrap so you can specify a custom break.
|
172
|
+
*Rafael Mendonça França*
|
318
173
|
|
319
|
-
|
174
|
+
* Render now accepts any keys for locals, including reserved keywords.
|
320
175
|
|
321
|
-
|
176
|
+
Only locals with valid variable names get set directly. Others
|
177
|
+
will still be available in `local_assigns`.
|
322
178
|
|
323
|
-
|
179
|
+
Example of render with reserved keywords:
|
324
180
|
|
325
181
|
```erb
|
326
|
-
|
327
|
-
<% # Template Dependency: recordings/threads/events/completed %>
|
328
|
-
<% # Template Dependency: recordings/threads/events/uncompleted %>
|
329
|
-
```
|
330
|
-
|
331
|
-
Into:
|
182
|
+
<%= render "example", class: "text-center", message: "Hello world!" %>
|
332
183
|
|
333
|
-
|
334
|
-
|
184
|
+
<!-- _example.html.erb: -->
|
185
|
+
<%= tag.div class: local_assigns[:class] do %>
|
186
|
+
<p><%= message %></p>
|
187
|
+
<% end %>
|
335
188
|
```
|
336
189
|
|
337
|
-
*
|
338
|
-
|
339
|
-
* Allow defining explicit collection caching using a `# Template Collection: ...`
|
340
|
-
directive inside templates.
|
341
|
-
|
342
|
-
*Dov Murik*
|
343
|
-
|
344
|
-
* Asset helpers raise `ArgumentError` when `nil` is passed as a source.
|
345
|
-
|
346
|
-
*Anton Kolomiychuk*
|
347
|
-
|
348
|
-
* Always attach the template digest to the cache key for collection caching
|
349
|
-
even when `virtual_path` is not available from the view context.
|
350
|
-
Which could happen if the rendering was done directly in the controller
|
351
|
-
and not in a template.
|
352
|
-
|
353
|
-
Fixes #20535.
|
354
|
-
|
355
|
-
*Roque Pinel*
|
356
|
-
|
357
|
-
* Improve detection of partial templates eligible for collection caching,
|
358
|
-
now allowing multi-line comments at the beginning of the template file.
|
359
|
-
|
360
|
-
*Dov Murik*
|
361
|
-
|
362
|
-
* Raise an `ArgumentError` when a false value for `include_blank` is passed to a
|
363
|
-
required select field (to comply with the HTML5 spec).
|
364
|
-
|
365
|
-
*Grey Baker*
|
366
|
-
|
367
|
-
* Do not put partial name to `local_assigns` when rendering without
|
368
|
-
an object or a collection.
|
369
|
-
|
370
|
-
*Henrik Nygren*
|
371
|
-
|
372
|
-
* Remove `:rescue_format` option for `translate` helper since it's no longer
|
373
|
-
supported by I18n.
|
374
|
-
|
375
|
-
*Bernard Potocki*
|
376
|
-
|
377
|
-
* `translate` should handle `raise` flag correctly in case of both main and default
|
378
|
-
translation is missing.
|
379
|
-
|
380
|
-
Fixes #19967.
|
381
|
-
|
382
|
-
*Bernard Potocki*
|
383
|
-
|
384
|
-
* Load the `default_form_builder` from the controller on initialization, which overrides
|
385
|
-
the global config if it is present.
|
386
|
-
|
387
|
-
*Kevin McPhillips*
|
388
|
-
|
389
|
-
* Accept lambda as `child_index` option in `fields_for` method.
|
390
|
-
|
391
|
-
*Karol Galanciak*
|
392
|
-
|
393
|
-
* `translate` allows `default: [[]]` again for a default value of `[]`.
|
394
|
-
|
395
|
-
Fixes #19640.
|
396
|
-
|
397
|
-
*Adam Prescott*
|
190
|
+
*Peter Schilling*, *Matthew Draper*
|
398
191
|
|
399
|
-
* `
|
400
|
-
parameter without raising a translation missing error.
|
192
|
+
* Add `:skip_pipeline` option to several asset tag helpers
|
401
193
|
|
402
|
-
|
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.
|
403
198
|
|
404
|
-
*
|
199
|
+
*Richard Schneeman*
|
405
200
|
|
406
|
-
* `
|
407
|
-
as input when `precision: 0` is used.
|
201
|
+
* Add `:poster_skip_pipeline` option to the `video_tag` helper
|
408
202
|
|
409
|
-
|
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.
|
410
206
|
|
411
|
-
*
|
207
|
+
*Richard Schneeman*
|
412
208
|
|
413
|
-
*
|
414
|
-
besides String.
|
209
|
+
* Show cache hits and misses when rendering partials.
|
415
210
|
|
416
|
-
|
211
|
+
Partials using the `cache` helper will show whether a render hit or missed
|
212
|
+
the cache:
|
417
213
|
|
418
|
-
|
419
|
-
|
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
|
+
```
|
420
218
|
|
421
|
-
|
219
|
+
This removes the need for the old fragment cache logging:
|
422
220
|
|
423
|
-
|
424
|
-
|
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
|
+
```
|
425
227
|
|
426
|
-
|
228
|
+
Though that full output can be reenabled with
|
229
|
+
`config.action_controller.enable_fragment_cache_logging = true`.
|
427
230
|
|
428
|
-
*
|
231
|
+
*Stan Lo*
|
429
232
|
|
430
|
-
|
233
|
+
* Changed partial rendering with a collection to allow collections which
|
234
|
+
implement `to_a`.
|
431
235
|
|
432
|
-
|
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.
|
433
241
|
|
434
|
-
*
|
242
|
+
*Steven Harman*
|
435
243
|
|
436
|
-
|
437
|
-
|
438
|
-
and underscores.
|
439
|
-
But now we can give our partials any name starting with underscore, such as
|
440
|
-
_🍔.html.erb.
|
244
|
+
* New syntax for tag helpers. Avoid positional parameters and support HTML5 by default.
|
245
|
+
Example usage of tag helpers before:
|
441
246
|
|
442
|
-
|
247
|
+
```ruby
|
248
|
+
tag(:br, nil, true)
|
249
|
+
content_tag(:div, content_tag(:p, "Hello world!"), class: "strong")
|
443
250
|
|
444
|
-
|
251
|
+
<%= content_tag :div, class: "strong" do -%>
|
252
|
+
Hello world!
|
253
|
+
<% end -%>
|
254
|
+
```
|
445
255
|
|
446
|
-
|
447
|
-
handler instead of ERB.
|
256
|
+
Example usage of tag helpers after:
|
448
257
|
|
449
|
-
|
258
|
+
```ruby
|
259
|
+
tag.br
|
260
|
+
tag.div tag.p("Hello world!"), class: "strong"
|
450
261
|
|
451
|
-
|
262
|
+
<%= tag.div class: "strong" do %>
|
263
|
+
Hello world!
|
264
|
+
<% end %>
|
265
|
+
```
|
452
266
|
|
453
|
-
*
|
267
|
+
*Marek Kirejczyk*, *Kasper Timm Hansen*
|
454
268
|
|
455
|
-
*
|
456
|
-
but are not themselves safe, should not be marked as html_safe.
|
269
|
+
* Change `datetime_field` and `datetime_field_tag` to generate `datetime-local` fields.
|
457
270
|
|
458
|
-
|
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)
|
459
274
|
|
460
|
-
*
|
275
|
+
*Herminio Torres*
|
461
276
|
|
462
|
-
|
277
|
+
* Raw template handler (which is also the default template handler in Rails 5) now outputs
|
278
|
+
HTML-safe strings.
|
463
279
|
|
464
|
-
|
465
|
-
|
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.
|
466
285
|
|
467
|
-
*
|
286
|
+
*Eileen M. Uchitelle*
|
468
287
|
|
469
|
-
*
|
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.
|
470
291
|
|
471
|
-
|
292
|
+
Generation of option before:
|
472
293
|
|
473
|
-
|
474
|
-
|
294
|
+
```html
|
295
|
+
<option value=""></option>
|
296
|
+
```
|
475
297
|
|
476
|
-
|
298
|
+
Generation of option after:
|
477
299
|
|
478
|
-
|
300
|
+
```html
|
301
|
+
<option value="" label=" "></option>
|
302
|
+
```
|
479
303
|
|
480
|
-
*
|
304
|
+
*Vipul A M*
|
481
305
|
|
482
|
-
Please check [
|
306
|
+
Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/actionview/CHANGELOG.md) for previous changes.
|
data/MIT-LICENSE
CHANGED