CHANGELOG.md 4.2 KB
Newer Older
1 2 3 4 5 6 7 8 9
*   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*

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

    *Dov Murik*

15 16 17 18 19
*   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*

20 21
*   Do not put partial name to `local_assigns` when rendering without
    an object or a collection.
22 23 24

    *Henrik Nygren*

25 26 27 28 29
*   Remove `:rescue_format` option for `translate` helper since it's no longer
    supported by I18n.

    *Bernard Potocki*

30 31 32 33 34 35 36
*   `translate` should handle `raise` flag correctly in case of both main and default
    translation is missing.

    Fixes #19967

    *Bernard Potocki*

37 38 39 40 41
*   Load the `default_form_builder` from the controller on initialization, which overrides
    the global config if it is present.

    *Kevin McPhillips*

42 43 44 45
*   Accept lambda as `child_index` option in `fields_for` method.

    *Karol Galanciak*

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

48
    Fixes #19640.
49 50 51

    *Adam Prescott*

52
*   `translate` should accept nils as members of the `:default`
Y
Yves Senn 已提交
53
    parameter without raising a translation missing error.
54 55 56 57 58

    Fixes #19419

    *Justin Coyne*

59 60 61 62 63 64 65
*   `number_to_percentage` does not crash with `Float::NAN` or `Float::INFINITY`
    as input when `precision: 0` is used.

    Fixes #19227.

    *Yves Senn*

66 67 68 69 70
*   Fixed the translation helper method to accept different default values types
    besides String.

    *Ulisses Almeida*

71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
*   Collection rendering automatically caches and fetches multiple partials.

    Collections rendered as:

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

    will now read several partials from cache at once, if the template starts with a cache call:

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

    *Kasper Timm Hansen*

J
Juho Leinonen 已提交
91 92 93 94 95
*   Fixed a dependency tracker bug that caused template dependencies not
    count layouts as dependencies for partials.

    *Juho Leinonen*

96 97 98 99 100
*   Extracted `ActionView::Helpers::RecordTagHelper` to external gem
    (`record_tag_helper`) and added removal notices.

    *Todd Bealmear*

101
*   Allow to pass a string value to `size` option in `image_tag` and `video_tag`.
102 103 104 105 106

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

    *Mehdi Lahmam*

107 108 109 110 111 112 113 114 115 116
*   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*

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

119
    Files without a template handler in their extension will be rendered using the raw
120 121 122 123
    handler instead of ERB.

    *Rafael Mendonça França*

124 125 126 127
*   Remove deprecated `AbstractController::Base::parent_prefixes`.

    *Rafael Mendonça França*

R
Robin Dupret 已提交
128
*   Default translations that have a lower precedence than a html safe default,
129 130 131 132
    but are not themselves safe, should not be marked as html_safe.

    *Justin Coyne*

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

    *Nikolay Shebanov*

137 138 139 140 141
*   Add a `hidden_field` on the `file_field` to avoid raise a error when the only
    input on the form is the `file_field`.

    *Mauro George*

R
Robin Dupret 已提交
142 143
*   Add an explicit error message, in `ActionView::PartialRenderer` for partial
    `rendering`, when the value of option `as` has invalid characters.
144 145 146

    *Angelo Capilleri*

147
*   Allow entries without a link tag in `AtomFeedHelper`.
148 149

    *Daniel Gomez de Souza*
150

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