aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/CHANGELOG.md
blob: c15fb4304d1269d56e7a12b881d2bdc3b957b635 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
*   Added log "Rendering ...", when starting to render a template to log that
    we have started rendering something. This helps to easily identify the origin
    of queries in the log whether they came from controller or views.

    *Vipul A M and Prem Sichanugrist*

## Rails 5.0.0.beta3 (February 24, 2016) ##

*   Collection rendering can cache and fetch multiple partials at once.

    Collections rendered as:

    ```ruby
    <%= render partial: 'notifications/notification', collection: @notifications, as: :notification, cached: true %>
    ```

    will read several partials from cache at once. The templates in the collection
    that haven't been cached already will automatically be written to cache. Works
    great alongside individual template fragment caching. For instance if the
    template the collection renders is cached like:

    ```ruby
    # notifications/_notification.html.erb
    <% cache notification do %>
      <%# ... %>
    <% end %>
    ```

    Then any collection renders shares that cache when attempting to read multiple
    ones at once.

    *Kasper Timm Hansen*

*   Add support for nested hashes/arrays to `:params` option of `button_to` helper.

    *James Coleman*

## Rails 5.0.0.beta2 (February 01, 2016) ##

*   Fix stripping the digest from the automatically generated img tag alt
    attribute when assets are handled by Sprockets >=3.0.

    *Bart de Water*

*   Create a new `ActiveSupport::SafeBuffer` instance when `content_for` is flushed.

    Fixes #19890

    *Yoong Kang Lim*

*   Fix `collection_radio_buttons` hidden_field name and make it appear
    before the actual input radio tags to make the real value override
    the hidden when passed.

    Fixes #22773.

    *Santiago Pastorino*

*   `ActionView::TestCase::Controller#params` returns an instance of
    `ActionController::Parameters`.

    *Justin Coyne*

*   Fix regression in `submit_tag` when a symbol is used as label argument.

    *Yuuji Yaginuma*


## Rails 5.0.0.beta1 (December 18, 2015) ##

*   `I18n.translate` helper will wrap the missing translation keys
     in a <span> tag only if `debug_missing_translation` configuration
     be true. Default value is `true`. For example in `application.rb`:

       # in order to turn off missing key wrapping
       config.action_view.debug_missing_translation = false

     *Sameer Rahmani*

*   Respect value of `:object` if `:object` is false when rendering.

    Fixes #22260.

    *Yuichiro Kaneko*

*   Generate `week_field` input values using a 1-based index and not a 0-based index
    as per the W3 spec: http://www.w3.org/TR/html-markup/datatypes.html#form.data.week

    *Christoph Geschwind*

*   Allow `host` option in `javascript_include_tag` and `stylesheet_link_tag` helpers

    *Grzegorz Witek*

*   Restrict `url_for :back` to valid, non-JavaScript URLs. GH#14444

    *Damien Burke*

*   Allow `date_select` helper selected option to accept hash like the default options.

    *Lecky Lao*

*   Collection input propagates input's `id` to the label's `for` attribute when
    using html options as the last element of collection.

    *Vasiliy Ermolovich*

*   Add a `hidden_field` on the `collection_radio_buttons` to avoid raising an error
    when the only input on the form is the `collection_radio_buttons`.

    *Mauro George*

*   `url_for` does not modify its arguments when generating polymorphic URLs.

    *Bernerd Schaefer*

*   `number_to_currency` and `number_with_delimiter` now accept a custom `delimiter_pattern` option
    to handle placement of delimiter, to support currency formats like INR.

    Example:

        number_to_currency(1230000, delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/, unit: '₹', format: "%u %n")
        # => '₹ 12,30,000.00'

    *Vipul A M*

*   Make `disable_with` the default behavior for submit tags. Disables the
    button on submit to prevent double submits.

    *Justin Schiff*

*   Add a break_sequence option to word_wrap so you can specify a custom break.

    *Mauricio Gomez*

*   Add wildcard matching to explicit dependencies.

    Turns:

    ```erb
    <% # Template Dependency: recordings/threads/events/subscribers_changed %>
    <% # Template Dependency: recordings/threads/events/completed %>
    <% # Template Dependency: recordings/threads/events/uncompleted %>
    ```

    Into:

    ```erb
    <% # Template Dependency: recordings/threads/events/* %>
    ```

    *Kasper Timm Hansen*

*   Allow defining explicit collection caching using a `# Template Collection: ...`
    directive inside templates.

    *Dov Murik*

*   Asset helpers raise `ArgumentError` when `nil` is passed as a source.

    *Anton Kolomiychuk*

*   Always attach the template digest to the cache key for collection caching
    even when `virtual_path` is not available from the view context.
    Which could happen if the rendering was done directly in the controller
    and not in a template.

    Fixes #20535.

    *Roque Pinel*

*   Improve detection of partial templates eligible for collection caching,
    now allowing multi-line comments at the beginning of the template file.

    *Dov Murik*

*   Raise an `ArgumentError` when a false value for `include_blank` is passed to a
    required select field (to comply with the HTML5 spec).

    *Grey Baker*

*   Do not put partial name to `local_assigns` when rendering without
    an object or a collection.

    *Henrik Nygren*

*   Remove `:rescue_format` option for `translate` helper since it's no longer
    supported by I18n.

    *Bernard Potocki*

*   `translate` should handle `raise` flag correctly in case of both main and default
    translation is missing.

    Fixes #19967.

    *Bernard Potocki*

*   Load the `default_form_builder` from the controller on initialization, which overrides
    the global config if it is present.

    *Kevin McPhillips*

*   Accept lambda as `child_index` option in `fields_for` method.

    *Karol Galanciak*

*   `translate` allows `default: [[]]` again for a default value of `[]`.

    Fixes #19640.

    *Adam Prescott*

*   `translate` should accept nils as members of the `:default`
    parameter without raising a translation missing error.

    Fixes #19419.

    *Justin Coyne*

*   `number_to_percentage` does not crash with `Float::NAN` or `Float::INFINITY`
    as input when `precision: 0` is used.

    Fixes #19227.

    *Yves Senn*

*   Fixed the translation helper method to accept different default values types
    besides String.

    *Ulisses Almeida*

*   Fixed a dependency tracker bug that caused template dependencies not
    count layouts as dependencies for partials.

    *Juho Leinonen*

*   Extracted `ActionView::Helpers::RecordTagHelper` to external gem
    (`record_tag_helper`) and added removal notices.

    *Todd Bealmear*

*   Allow to pass a string value to `size` option in `image_tag` and `video_tag`.

    This makes the behavior more consistent with `width` or `height` options.

    *Mehdi Lahmam*

*   Partial template name does no more have to be a valid Ruby identifier.

    There used to be a naming rule that the partial name should start with
    underscore, and should be followed by any combination of letters, numbers
    and underscores.
    But now we can give our partials any name starting with underscore, such as
    _🍔.html.erb.

    *Akira Matsuda*

*   Change the default template handler from `ERB` to `Raw`.

    Files without a template handler in their extension will be rendered using the raw
    handler instead of ERB.

    *Rafael Mendonça França*

*   Remove deprecated `AbstractController::Base::parent_prefixes`.

    *Rafael Mendonça França*

*   Default translations that have a lower precedence than a html safe default,
    but are not themselves safe, should not be marked as html_safe.

    *Justin Coyne*

*   Make possible to use blocks with short version of `render "partial"` helper.

    *Nikolay Shebanov*

*   Add a `hidden_field` on the `file_field` to avoid raising an error when the only
    input on the form is the `file_field`.

    *Mauro George*

*   Add an explicit error message, in `ActionView::PartialRenderer` for partial
    `rendering`, when the value of option `as` has invalid characters.

    *Angelo Capilleri*

*   Allow entries without a link tag in `AtomFeedHelper`.

    *Daniel Gomez de Souza*

Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionview/CHANGELOG.md) for previous changes.