actionview 4.2.11.1 → 7.0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +229 -215
- data/MIT-LICENSE +1 -1
- data/README.rdoc +9 -8
- data/lib/action_view/base.rb +116 -43
- data/lib/action_view/buffers.rb +20 -3
- data/lib/action_view/cache_expiry.rb +66 -0
- data/lib/action_view/context.rb +8 -12
- data/lib/action_view/dependency_tracker/erb_tracker.rb +154 -0
- data/lib/action_view/dependency_tracker/ripper_tracker.rb +59 -0
- data/lib/action_view/dependency_tracker.rb +21 -122
- data/lib/action_view/digestor.rb +92 -85
- data/lib/action_view/flows.rb +15 -16
- data/lib/action_view/gem_version.rb +6 -4
- data/lib/action_view/helpers/active_model_helper.rb +17 -12
- data/lib/action_view/helpers/asset_tag_helper.rb +356 -101
- data/lib/action_view/helpers/asset_url_helper.rb +180 -74
- data/lib/action_view/helpers/atom_feed_helper.rb +21 -19
- data/lib/action_view/helpers/cache_helper.rb +156 -43
- data/lib/action_view/helpers/capture_helper.rb +21 -14
- data/lib/action_view/helpers/controller_helper.rb +16 -5
- data/lib/action_view/helpers/csp_helper.rb +26 -0
- data/lib/action_view/helpers/csrf_helper.rb +8 -6
- data/lib/action_view/helpers/date_helper.rb +288 -132
- data/lib/action_view/helpers/debug_helper.rb +9 -6
- data/lib/action_view/helpers/form_helper.rb +956 -173
- data/lib/action_view/helpers/form_options_helper.rb +178 -97
- data/lib/action_view/helpers/form_tag_helper.rb +220 -101
- data/lib/action_view/helpers/javascript_helper.rb +33 -19
- data/lib/action_view/helpers/number_helper.rb +88 -63
- data/lib/action_view/helpers/output_safety_helper.rb +38 -6
- data/lib/action_view/helpers/rendering_helper.rb +21 -10
- data/lib/action_view/helpers/sanitize_helper.rb +31 -32
- data/lib/action_view/helpers/tag_helper.rb +332 -71
- data/lib/action_view/helpers/tags/base.rb +123 -99
- data/lib/action_view/helpers/tags/check_box.rb +21 -20
- data/lib/action_view/helpers/tags/checkable.rb +4 -2
- data/lib/action_view/helpers/tags/collection_check_boxes.rb +12 -34
- data/lib/action_view/helpers/tags/collection_helpers.rb +69 -36
- data/lib/action_view/helpers/tags/collection_radio_buttons.rb +6 -12
- data/lib/action_view/helpers/tags/collection_select.rb +5 -3
- data/lib/action_view/helpers/tags/color_field.rb +4 -3
- data/lib/action_view/helpers/tags/date_field.rb +3 -2
- data/lib/action_view/helpers/tags/date_select.rb +38 -37
- data/lib/action_view/helpers/tags/datetime_field.rb +4 -3
- data/lib/action_view/helpers/tags/datetime_local_field.rb +3 -2
- data/lib/action_view/helpers/tags/datetime_select.rb +2 -0
- data/lib/action_view/helpers/tags/email_field.rb +2 -0
- data/lib/action_view/helpers/tags/file_field.rb +18 -0
- data/lib/action_view/helpers/tags/grouped_collection_select.rb +4 -2
- data/lib/action_view/helpers/tags/hidden_field.rb +6 -0
- data/lib/action_view/helpers/tags/label.rb +7 -2
- data/lib/action_view/helpers/tags/month_field.rb +3 -2
- data/lib/action_view/helpers/tags/number_field.rb +2 -0
- data/lib/action_view/helpers/tags/password_field.rb +3 -1
- data/lib/action_view/helpers/tags/placeholderable.rb +3 -1
- data/lib/action_view/helpers/tags/radio_button.rb +7 -6
- data/lib/action_view/helpers/tags/range_field.rb +2 -0
- data/lib/action_view/helpers/tags/search_field.rb +14 -9
- data/lib/action_view/helpers/tags/select.rb +11 -10
- data/lib/action_view/helpers/tags/tel_field.rb +2 -0
- data/lib/action_view/helpers/tags/text_area.rb +4 -2
- data/lib/action_view/helpers/tags/text_field.rb +8 -8
- data/lib/action_view/helpers/tags/time_field.rb +12 -2
- data/lib/action_view/helpers/tags/time_select.rb +2 -0
- data/lib/action_view/helpers/tags/time_zone_select.rb +3 -1
- data/lib/action_view/helpers/tags/translator.rb +15 -16
- data/lib/action_view/helpers/tags/url_field.rb +2 -0
- data/lib/action_view/helpers/tags/week_field.rb +3 -2
- data/lib/action_view/helpers/tags/weekday_select.rb +28 -0
- data/lib/action_view/helpers/tags.rb +5 -2
- data/lib/action_view/helpers/text_helper.rb +80 -51
- data/lib/action_view/helpers/translation_helper.rb +120 -69
- data/lib/action_view/helpers/url_helper.rb +398 -171
- data/lib/action_view/helpers.rb +29 -27
- data/lib/action_view/layouts.rb +68 -63
- data/lib/action_view/log_subscriber.rb +77 -10
- data/lib/action_view/lookup_context.rb +137 -113
- data/lib/action_view/model_naming.rb +4 -2
- data/lib/action_view/path_set.rb +28 -32
- data/lib/action_view/railtie.rb +74 -13
- data/lib/action_view/record_identifier.rb +53 -26
- data/lib/action_view/render_parser.rb +188 -0
- data/lib/action_view/renderer/abstract_renderer.rb +152 -15
- data/lib/action_view/renderer/collection_renderer.rb +196 -0
- data/lib/action_view/renderer/object_renderer.rb +34 -0
- data/lib/action_view/renderer/partial_renderer/collection_caching.rb +102 -0
- data/lib/action_view/renderer/partial_renderer.rb +51 -333
- data/lib/action_view/renderer/renderer.rb +68 -11
- data/lib/action_view/renderer/streaming_template_renderer.rb +60 -56
- data/lib/action_view/renderer/template_renderer.rb +87 -74
- data/lib/action_view/rendering.rb +73 -47
- data/lib/action_view/ripper_ast_parser.rb +198 -0
- data/lib/action_view/routing_url_for.rb +35 -24
- data/lib/action_view/tasks/cache_digests.rake +25 -0
- data/lib/action_view/template/error.rb +151 -41
- data/lib/action_view/template/handlers/builder.rb +12 -13
- data/lib/action_view/template/handlers/erb/erubi.rb +89 -0
- data/lib/action_view/template/handlers/erb.rb +29 -89
- data/lib/action_view/template/handlers/html.rb +11 -0
- data/lib/action_view/template/handlers/raw.rb +4 -4
- data/lib/action_view/template/handlers.rb +14 -10
- data/lib/action_view/template/html.rb +12 -13
- data/lib/action_view/template/inline.rb +22 -0
- data/lib/action_view/template/raw_file.rb +25 -0
- data/lib/action_view/template/renderable.rb +24 -0
- data/lib/action_view/template/resolver.rb +139 -300
- data/lib/action_view/template/sources/file.rb +17 -0
- data/lib/action_view/template/sources.rb +13 -0
- data/lib/action_view/template/text.rb +10 -12
- data/lib/action_view/template/types.rb +28 -26
- data/lib/action_view/template.rb +123 -91
- data/lib/action_view/template_details.rb +66 -0
- data/lib/action_view/template_path.rb +64 -0
- data/lib/action_view/test_case.rb +70 -53
- data/lib/action_view/testing/resolvers.rb +25 -35
- data/lib/action_view/unbound_template.rb +57 -0
- data/lib/action_view/version.rb +3 -1
- data/lib/action_view/view_paths.rb +73 -58
- data/lib/action_view.rb +16 -11
- data/lib/assets/compiled/rails-ujs.js +746 -0
- metadata +52 -32
- data/lib/action_view/helpers/record_tag_helper.rb +0 -108
- data/lib/action_view/tasks/dependencies.rake +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05b202fb72d79b08cc80097deb5e09fda321f310a8a06c361599e95a76c16cfc
|
4
|
+
data.tar.gz: 64d8271b6a06f9de6f6692b96a1ba3016b53d10b068df1c41db4c81094e642d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42594ba6f50e9611210173d7a4e42351c928acf1024ea33858d91679b20df6d8fb5b49aa7f21ee147827efcf005ffdb60025cc15293d4f462c1927c3c251155e
|
7
|
+
data.tar.gz: ac02f50538a88bc0fec35186567e376c95908cc791b500b24fbcdcbc9ae0a0c839a0f9245e9fae67ea6dde9304e53fe62ad30f0ad4bdf96aced044651df7f4f8
|
data/CHANGELOG.md
CHANGED
@@ -1,357 +1,371 @@
|
|
1
|
-
## Rails
|
1
|
+
## Rails 7.0.2.4 (April 26, 2022) ##
|
2
2
|
|
3
|
-
*
|
4
|
-
|
5
|
-
|
6
|
-
## Rails 4.2.11 (November 27, 2018) ##
|
3
|
+
* Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
|
7
4
|
|
8
|
-
|
5
|
+
Escape dangerous characters in names of tags and names of attributes in the
|
6
|
+
tag helpers, following the XML specification. Rename the option
|
7
|
+
`:escape_attributes` to `:escape`, to simplify by applying the option to the
|
8
|
+
whole tag.
|
9
9
|
|
10
|
+
*Álvaro Martín Fraguas*
|
10
11
|
|
11
|
-
## Rails
|
12
|
+
## Rails 7.0.2.3 (March 08, 2022) ##
|
12
13
|
|
13
14
|
* No changes.
|
14
15
|
|
15
16
|
|
16
|
-
## Rails
|
17
|
+
## Rails 7.0.2.2 (February 11, 2022) ##
|
17
18
|
|
18
19
|
* No changes.
|
19
20
|
|
20
21
|
|
21
|
-
## Rails
|
22
|
+
## Rails 7.0.2.1 (February 11, 2022) ##
|
22
23
|
|
23
24
|
* No changes.
|
24
25
|
|
25
26
|
|
26
|
-
## Rails
|
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.
|
35
|
-
|
36
|
-
*Bart de Water*
|
37
|
-
|
38
|
-
* Create a new `ActiveSupport::SafeBuffer` instance when `content_for` is flushed.
|
27
|
+
## Rails 7.0.2 (February 08, 2022) ##
|
39
28
|
|
40
|
-
|
29
|
+
* Ensure `preload_link_tag` preloads JavaScript modules correctly.
|
41
30
|
|
42
|
-
*
|
31
|
+
*Máximo Mussini*
|
43
32
|
|
44
|
-
*
|
33
|
+
* Fix `stylesheet_link_tag` and similar helpers are being used to work in objects with
|
34
|
+
a `response` method.
|
45
35
|
|
46
|
-
|
36
|
+
*dark-panda*
|
47
37
|
|
48
|
-
*Yuichiro Kaneko*
|
49
38
|
|
50
|
-
|
51
|
-
as per the W3 spec: http://www.w3.org/TR/html-markup/datatypes.html#form.data.week
|
39
|
+
## Rails 7.0.1 (January 06, 2022) ##
|
52
40
|
|
53
|
-
|
41
|
+
* Fix `button_to` to work with a hash parameter as URL.
|
54
42
|
|
43
|
+
*MingyuanQin*
|
55
44
|
|
56
|
-
|
45
|
+
* Fix `link_to` with a model passed as an argument twice.
|
57
46
|
|
58
|
-
*
|
47
|
+
*Alex Ghiculescu*
|
59
48
|
|
60
|
-
Fixes CVE-2016-2098.
|
61
49
|
|
62
|
-
|
50
|
+
## Rails 7.0.0 (December 15, 2021) ##
|
63
51
|
|
52
|
+
* Support `include_hidden:` option in calls to
|
53
|
+
`ActionView::Helper::FormBuilder#file_field` with `multiple: true` to
|
54
|
+
support submitting an empty collection of files.
|
64
55
|
|
65
|
-
|
56
|
+
```ruby
|
57
|
+
form.file_field :attachments, multiple: true
|
58
|
+
# => <input type="hidden" autocomplete="off" name="post[attachments][]" value="">
|
59
|
+
<input type="file" multiple="multiple" id="post_attachments" name="post[attachments][]">
|
66
60
|
|
67
|
-
|
68
|
-
|
61
|
+
form.file_field :attachments, multiple: true, include_hidden: false
|
62
|
+
# => <input type="file" multiple="multiple" id="post_attachments" name="post[attachments][]">
|
63
|
+
```
|
69
64
|
|
70
|
-
*
|
65
|
+
*Sean Doyle*
|
71
66
|
|
67
|
+
* Fix `number_with_precision(raise: true)` always raising even on valid numbers.
|
72
68
|
|
73
|
-
|
69
|
+
*Pedro Moreira*
|
74
70
|
|
75
|
-
* Fix `mail_to` when called with `nil` as argument.
|
76
71
|
|
77
|
-
|
72
|
+
## Rails 7.0.0.rc3 (December 14, 2021) ##
|
78
73
|
|
79
|
-
*
|
80
|
-
|
81
|
-
*Bernerd Schaefer*
|
82
|
-
|
83
|
-
|
84
|
-
## Rails 4.2.4 (August 24, 2015) ##
|
85
|
-
|
86
|
-
* No Changes *
|
87
|
-
|
88
|
-
|
89
|
-
## Rails 4.2.3 (June 25, 2015) ##
|
90
|
-
|
91
|
-
* `translate` should handle `raise` flag correctly in case of both main and default
|
92
|
-
translation is missing.
|
74
|
+
* No changes.
|
93
75
|
|
94
|
-
Fixes #19967
|
95
76
|
|
96
|
-
|
77
|
+
## Rails 7.0.0.rc2 (December 14, 2021) ##
|
97
78
|
|
98
|
-
*
|
79
|
+
* No changes.
|
99
80
|
|
100
|
-
|
81
|
+
## Rails 7.0.0.rc1 (December 06, 2021) ##
|
101
82
|
|
102
|
-
|
83
|
+
* Support `fields model: [@nested, @model]` the same way as `form_with model:
|
84
|
+
[@nested, @model]`.
|
103
85
|
|
104
|
-
*
|
105
|
-
parameter without raising a translation missing error. Fixes a
|
106
|
-
regression introduced 362557e.
|
86
|
+
*Sean Doyle*
|
107
87
|
|
108
|
-
|
88
|
+
* Infer HTTP verb `[method]` from a model or Array with model as the first
|
89
|
+
argument to `button_to` when combined with a block:
|
109
90
|
|
110
|
-
|
91
|
+
```ruby
|
92
|
+
button_to(Workshop.find(1)){ "Update" }
|
93
|
+
#=> <form method="post" action="/workshops/1" class="button_to">
|
94
|
+
#=> <input type="hidden" name="_method" value="patch" autocomplete="off" />
|
95
|
+
#=> <button type="submit">Update</button>
|
96
|
+
#=> </form>
|
111
97
|
|
112
|
-
|
113
|
-
|
98
|
+
button_to([ Workshop.find(1), Session.find(1) ]) { "Update" }
|
99
|
+
#=> <form method="post" action="/workshops/1/sessions/1" class="button_to">
|
100
|
+
#=> <input type="hidden" name="_method" value="patch" autocomplete="off" />
|
101
|
+
#=> <button type="submit">Update</button>
|
102
|
+
#=> </form>
|
103
|
+
```
|
114
104
|
|
115
|
-
|
105
|
+
*Sean Doyle*
|
116
106
|
|
117
|
-
|
107
|
+
* Support passing a Symbol as the first argument to `FormBuilder#button`:
|
118
108
|
|
109
|
+
```ruby
|
110
|
+
form.button(:draft, value: true)
|
111
|
+
# => <button name="post[draft]" value="true" type="submit">Create post</button>
|
119
112
|
|
120
|
-
|
113
|
+
form.button(:draft, value: true) do
|
114
|
+
content_tag(:strong, "Save as draft")
|
115
|
+
end
|
116
|
+
# => <button name="post[draft]" value="true" type="submit">
|
117
|
+
# <strong>Save as draft</strong>
|
118
|
+
# </button>
|
119
|
+
```
|
121
120
|
|
122
|
-
*
|
121
|
+
*Sean Doyle*
|
123
122
|
|
123
|
+
* Introduce the `field_name` view helper, along with the
|
124
|
+
`FormBuilder#field_name` counterpart:
|
124
125
|
|
125
|
-
|
126
|
+
```ruby
|
127
|
+
form_for @post do |f|
|
128
|
+
f.field_tag :tag, name: f.field_name(:tag, multiple: true)
|
129
|
+
# => <input type="text" name="post[tag][]">
|
130
|
+
end
|
131
|
+
```
|
126
132
|
|
127
|
-
*
|
128
|
-
but are not themselves safe, should not be marked as html_safe.
|
133
|
+
*Sean Doyle*
|
129
134
|
|
130
|
-
|
135
|
+
* Execute the `ActionView::Base.field_error_proc` within the context of the
|
136
|
+
`ActionView::Base` instance:
|
131
137
|
|
132
|
-
|
133
|
-
|
138
|
+
```ruby
|
139
|
+
config.action_view.field_error_proc = proc { |html| content_tag(:div, html, class: "field_with_errors") }
|
140
|
+
```
|
134
141
|
|
135
|
-
*
|
142
|
+
*Sean Doyle*
|
136
143
|
|
144
|
+
* Add support for `button_to ..., authenticity_token: false`
|
137
145
|
|
138
|
-
|
146
|
+
```ruby
|
147
|
+
button_to "Create", Post.new, authenticity_token: false
|
148
|
+
# => <form class="button_to" method="post" action="/posts"><button type="submit">Create</button></form>
|
139
149
|
|
140
|
-
|
141
|
-
|
150
|
+
button_to "Create", Post.new, authenticity_token: true
|
151
|
+
# => <form class="button_to" method="post" action="/posts"><button type="submit">Create</button><input type="hidden" name="form_token" value="abc123..." autocomplete="off" /></form>
|
142
152
|
|
143
|
-
|
153
|
+
button_to "Create", Post.new, authenticity_token: "secret"
|
154
|
+
# => <form class="button_to" method="post" action="/posts"><button type="submit">Create</button><input type="hidden" name="form_token" value="secret" autocomplete="off" /></form>
|
155
|
+
```
|
144
156
|
|
145
|
-
*
|
157
|
+
*Sean Doyle*
|
146
158
|
|
147
|
-
*
|
159
|
+
* Support rendering `<form>` elements _without_ `[action]` attributes by:
|
148
160
|
|
149
|
-
|
150
|
-
|
161
|
+
* `form_with url: false` or `form_with ..., html: { action: false }`
|
162
|
+
* `form_for ..., url: false` or `form_for ..., html: { action: false }`
|
163
|
+
* `form_tag false` or `form_tag ..., action: false`
|
164
|
+
* `button_to "...", false` or `button_to(false) { ... }`
|
151
165
|
|
152
|
-
*
|
166
|
+
*Sean Doyle*
|
153
167
|
|
154
|
-
*
|
155
|
-
as Ruby block calls.
|
168
|
+
* Add `:day_format` option to `date_select`
|
156
169
|
|
157
|
-
|
170
|
+
date_select("article", "written_on", day_format: ->(day) { day.ordinalize })
|
171
|
+
# generates day options like <option value="1">1st</option>\n<option value="2">2nd</option>...
|
158
172
|
|
159
|
-
*
|
173
|
+
*Shunichi Ikegami*
|
160
174
|
|
161
|
-
|
175
|
+
* Allow `link_to` helper to infer link name from `Model#to_s` when it
|
176
|
+
is used with a single argument:
|
162
177
|
|
163
|
-
|
178
|
+
link_to @profile
|
179
|
+
#=> <a href="/profiles/1">Eileen</a>
|
164
180
|
|
165
|
-
|
181
|
+
This assumes the model class implements a `to_s` method like this:
|
166
182
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
183
|
+
class Profile < ApplicationRecord
|
184
|
+
# ...
|
185
|
+
def to_s
|
186
|
+
name
|
187
|
+
end
|
188
|
+
end
|
171
189
|
|
172
|
-
|
190
|
+
Previously you had to supply a second argument even if the `Profile`
|
191
|
+
model implemented a `#to_s` method that called the `name` method.
|
173
192
|
|
174
|
-
|
193
|
+
link_to @profile, @profile.name
|
194
|
+
#=> <a href="/profiles/1">Eileen</a>
|
175
195
|
|
176
|
-
|
196
|
+
*Olivier Lacan*
|
177
197
|
|
178
|
-
|
198
|
+
* Support svg unpaired tags for `tag` helper.
|
179
199
|
|
180
|
-
|
200
|
+
tag.svg { tag.use('href' => "#cool-icon") }
|
201
|
+
# => <svg><use href="#cool-icon"></svg>
|
181
202
|
|
182
|
-
|
203
|
+
*Oleksii Vasyliev*
|
183
204
|
|
184
|
-
*Paola Garcia Casadiego*
|
185
205
|
|
186
|
-
|
206
|
+
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
187
207
|
|
188
|
-
|
189
|
-
when you want to customize how a particular label is presented.
|
208
|
+
* No changes.
|
190
209
|
|
191
|
-
*Alex Robbin*
|
192
210
|
|
193
|
-
|
211
|
+
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
194
212
|
|
195
|
-
|
213
|
+
* Improves the performance of ActionView::Helpers::NumberHelper formatters by avoiding the use of
|
214
|
+
exceptions as flow control.
|
196
215
|
|
197
|
-
*
|
216
|
+
*Mike Dalessio*
|
198
217
|
|
199
|
-
*
|
218
|
+
* `preload_link_tag` properly inserts `as` attributes for files with `image` MIME types, such as JPG or SVG.
|
200
219
|
|
201
|
-
*
|
220
|
+
*Nate Berkopec*
|
202
221
|
|
203
|
-
* Add `
|
222
|
+
* Add `weekday_options_for_select` and `weekday_select` helper methods. Also adds `weekday_select` to `FormBuilder`.
|
204
223
|
|
205
|
-
|
206
|
-
`#{template_name}_iteration` when rendering partials with collections.
|
224
|
+
*Drew Bragg*, *Dana Kashubeck*, *Kasper Timm Hansen*
|
207
225
|
|
208
|
-
|
209
|
-
the current `index` and two convenience methods `first?` and `last?`.
|
226
|
+
* 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.
|
210
227
|
|
211
|
-
*
|
228
|
+
*Ben Toews*, *John Hawthorn*, *Kasper Timm Hansen*, *Joel Hawksley*
|
212
229
|
|
213
|
-
*
|
214
|
-
of the `asset_host` proc returning nil.
|
230
|
+
* Add `include_seconds` option for `time_field`.
|
215
231
|
|
216
|
-
|
232
|
+
<%= form.time_field :foo, include_seconds: false %>
|
233
|
+
# => <input value="16:22" type="time" />
|
217
234
|
|
218
|
-
|
235
|
+
Default includes seconds:
|
219
236
|
|
220
|
-
|
237
|
+
<%= form.time_field :foo %>
|
238
|
+
# => <input value="16:22:01.440" type="time" />
|
221
239
|
|
222
|
-
|
240
|
+
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.
|
223
241
|
|
224
|
-
*
|
242
|
+
*Alex Ghiculescu*
|
225
243
|
|
226
|
-
*
|
227
|
-
option.
|
244
|
+
* Improve error messages when template file does not exist at absolute filepath.
|
228
245
|
|
229
|
-
*
|
246
|
+
*Ted Whang*
|
230
247
|
|
231
|
-
*
|
248
|
+
* Add `:country_code` option to `sms_to` for consistency with `phone_to`.
|
232
249
|
|
233
|
-
*
|
250
|
+
*Jonathan Hefner*
|
234
251
|
|
235
|
-
*
|
236
|
-
`Array#join`.
|
252
|
+
* OpenSSL constants are now used for Digest computations.
|
237
253
|
|
238
|
-
*
|
254
|
+
*Dirkjan Bussink*
|
239
255
|
|
240
|
-
*
|
241
|
-
|
256
|
+
* The `translate` helper now passes `default` values that aren't
|
257
|
+
translation keys through `I18n.translate` for interpolation.
|
242
258
|
|
243
|
-
*
|
259
|
+
*Jonathan Hefner*
|
244
260
|
|
245
|
-
*
|
261
|
+
* Adds option `extname` to `stylesheet_link_tag` to skip default
|
262
|
+
`.css` extension appended to the stylesheet path.
|
246
263
|
|
247
|
-
|
264
|
+
Before:
|
248
265
|
|
249
|
-
|
266
|
+
```ruby
|
267
|
+
stylesheet_link_tag "style.less"
|
268
|
+
# <link href="/stylesheets/style.less.scss" rel="stylesheet">
|
269
|
+
```
|
250
270
|
|
251
|
-
|
271
|
+
After:
|
252
272
|
|
253
|
-
|
273
|
+
```ruby
|
274
|
+
stylesheet_link_tag "style.less", extname: false, skip_pipeline: true, rel: "stylesheet/less"
|
275
|
+
# <link href="/stylesheets/style.less" rel="stylesheet/less">
|
276
|
+
```
|
254
277
|
|
255
|
-
*
|
256
|
-
overwrites `config.action_controller.asset_host` for particular asset.
|
278
|
+
*Abhay Nikam*
|
257
279
|
|
258
|
-
|
280
|
+
* Deprecate `render` locals to be assigned to instance variables.
|
259
281
|
|
260
|
-
*
|
261
|
-
Override `AbstractController::Base.local_prefixes` when you want to change
|
262
|
-
where to find views.
|
282
|
+
*Petrik de Heus*
|
263
283
|
|
264
|
-
|
284
|
+
* Remove legacy default `media=screen` from `stylesheet_link_tag`.
|
265
285
|
|
266
|
-
*
|
286
|
+
*André Luis Leal Cardoso Junior*
|
267
287
|
|
268
|
-
|
288
|
+
* Change `ActionView::Helpers::FormBuilder#button` to transform `formmethod`
|
289
|
+
attributes into `_method="$VERB"` Form Data to enable varied same-form actions:
|
269
290
|
|
270
|
-
|
271
|
-
|
272
|
-
<%=
|
291
|
+
<%= form_with model: post, method: :put do %>
|
292
|
+
<%= form.button "Update" %>
|
293
|
+
<%= form.button "Delete", formmethod: :delete %>
|
273
294
|
<% end %>
|
295
|
+
<%# => <form action="posts/1">
|
296
|
+
=> <input type="hidden" name="_method" value="put">
|
297
|
+
=> <button type="submit">Update</button>
|
298
|
+
=> <button type="submit" formmethod="post" name="_method" value="delete">Delete</button>
|
299
|
+
=> </form>
|
300
|
+
%>
|
274
301
|
|
275
|
-
|
276
|
-
en:
|
277
|
-
activerecord:
|
278
|
-
attributes:
|
279
|
-
post/long: "Long-form Post"
|
280
|
-
|
281
|
-
Used to simply return "long", but now it will return "Long-form
|
282
|
-
Post".
|
283
|
-
|
284
|
-
*Joshua Cody*
|
285
|
-
|
286
|
-
* Change `asset_path` to use File.join to create proper paths:
|
287
|
-
|
288
|
-
Before:
|
289
|
-
|
290
|
-
https://some.host.com//assets/some.js
|
291
|
-
|
292
|
-
After:
|
293
|
-
|
294
|
-
https://some.host.com/assets/some.js
|
302
|
+
*Sean Doyle*
|
295
303
|
|
296
|
-
|
304
|
+
* Change `ActionView::Helpers::UrlHelper#button_to` to *always* render a
|
305
|
+
`<button>` element, regardless of whether or not the content is passed as
|
306
|
+
the first argument or as a block.
|
297
307
|
|
298
|
-
|
299
|
-
|
308
|
+
<%= button_to "Delete", post_path(@post), method: :delete %>
|
309
|
+
# => <form action="/posts/1"><input type="hidden" name="_method" value="delete"><button type="submit">Delete</button></form>
|
300
310
|
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
<
|
305
|
-
|
306
|
-
After:
|
307
|
-
|
308
|
-
# => favicon_link_tag 'myicon.ico'
|
309
|
-
<link href="/assets/myicon.ico" rel="shortcut icon" type="image/x-icon" />
|
310
|
-
|
311
|
-
*Geoffroy Lorieux*
|
311
|
+
<%= button_to post_path(@post), method: :delete do %>
|
312
|
+
Delete
|
313
|
+
<% end %>
|
314
|
+
# => <form action="/posts/1"><input type="hidden" name="_method" value="delete"><button type="submit">Delete</button></form>
|
312
315
|
|
313
|
-
*
|
316
|
+
*Sean Doyle*, *Dusan Orlovic*
|
314
317
|
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
+
* Add `config.action_view.preload_links_header` to allow disabling of
|
319
|
+
the `Link` header being added by default when using `stylesheet_link_tag`
|
320
|
+
and `javascript_include_tag`.
|
318
321
|
|
319
|
-
*
|
322
|
+
*Andrew White*
|
320
323
|
|
321
|
-
* `
|
324
|
+
* The `translate` helper now resolves `default` values when a `nil` key is
|
325
|
+
specified, instead of always returning `nil`.
|
322
326
|
|
323
|
-
|
327
|
+
*Jonathan Hefner*
|
324
328
|
|
325
|
-
|
329
|
+
* Add `config.action_view.image_loading` to configure the default value of
|
330
|
+
the `image_tag` `:loading` option.
|
326
331
|
|
327
|
-
|
332
|
+
By setting `config.action_view.image_loading = "lazy"`, an application can opt in to
|
333
|
+
lazy loading images sitewide, without changing view code.
|
328
334
|
|
329
|
-
*
|
335
|
+
*Jonathan Hefner*
|
330
336
|
|
331
|
-
* `
|
332
|
-
|
337
|
+
* `ActionView::Helpers::FormBuilder#id` returns the value
|
338
|
+
of the `<form>` element's `id` attribute. With a `method` argument, returns
|
339
|
+
the `id` attribute for a form field with that name.
|
333
340
|
|
334
|
-
|
341
|
+
<%= form_for @post do |f| %>
|
342
|
+
<%# ... %>
|
335
343
|
|
336
|
-
|
344
|
+
<% content_for :sticky_footer do %>
|
345
|
+
<%= form.button(form: f.id) %>
|
346
|
+
<% end %>
|
347
|
+
<% end %>
|
337
348
|
|
338
|
-
*
|
349
|
+
*Sean Doyle*
|
339
350
|
|
340
|
-
|
351
|
+
* `ActionView::Helpers::FormBuilder#field_id` returns the value generated by
|
352
|
+
the FormBuilder for the given attribute name.
|
341
353
|
|
342
|
-
|
343
|
-
|
354
|
+
<%= form_for @post do |f| %>
|
355
|
+
<%= f.label :title %>
|
356
|
+
<%= f.text_field :title, aria: { describedby: f.field_id(:title, :error) } %>
|
357
|
+
<%= tag.span("is blank", id: f.field_id(:title, :error) %>
|
358
|
+
<% end %>
|
344
359
|
|
345
|
-
|
360
|
+
*Sean Doyle*
|
346
361
|
|
347
|
-
|
362
|
+
* Add `tag.attributes` to transform a Hash into HTML Attributes, ready to be
|
363
|
+
interpolated into ERB.
|
348
364
|
|
349
|
-
|
365
|
+
<input <%= tag.attributes(type: :text, aria: { label: "Search" }) %> >
|
366
|
+
# => <input type="text" aria-label="Search">
|
350
367
|
|
351
|
-
|
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.
|
368
|
+
*Sean Doyle*
|
354
369
|
|
355
|
-
*Piotr Chmolowski, Łukasz Strzałkowski*
|
356
370
|
|
357
|
-
Please check [
|
371
|
+
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionview/CHANGELOG.md) for previous changes.
|
data/MIT-LICENSE
CHANGED