CHANGELOG.md 6.2 KB
Newer Older
Y
yuuji.yaginuma 已提交
1
*   Allow `host` option in `javascript_include_tag` and `stylesheet_link_tag` helpers
2 3 4

    *Grzegorz Witek*

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

    *Damien Burke*

S
Sean Griffin 已提交
9 10 11 12
*   Allow `date_select` helper selected option to accept hash like the default options.

    *Lecky Lao*

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

    *Vasiliy Ermolovich*

18 19 20 21 22
*   Add a `hidden_field` on the `collection_radio_buttons` to avoid raising a error
    when the only input on the form is the `collection_radio_buttons`.

    *Mauro George*

23 24 25 26
*   `url_for` does not modify its arguments when generating polymorphic URLs.

    *Bernerd Schaefer*

27 28 29 30 31 32 33 34 35 36
*   `number_to_currency` and `number_with_delimiter` now accept 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*
    
37 38 39 40 41
*   Make `disable_with` the default behavior for submit tags. Disables the
    button on submit to prevent double submits.

    *Justin Schiff*

42 43 44 45
*   Add a break_sequence option to word_wrap so you can specify a custom break.

    * Mauricio Gomez *

46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
*   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*

64 65 66 67 68
*   Allow defining explicit collection caching using a `# Template Collection: ...`
    directive inside templates.

    *Dov Murik*

69 70 71 72
*   Asset helpers raise `ArgumentError` when `nil` is passed as a source.

    *Anton Kolomiychuk*

73 74 75 76 77 78 79 80 81
*   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*

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

    *Dov Murik*

87 88 89 90 91
*   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*

92 93
*   Do not put partial name to `local_assigns` when rendering without
    an object or a collection.
94 95 96

    *Henrik Nygren*

97 98 99 100 101
*   Remove `:rescue_format` option for `translate` helper since it's no longer
    supported by I18n.

    *Bernard Potocki*

102 103 104 105 106 107 108
*   `translate` should handle `raise` flag correctly in case of both main and default
    translation is missing.

    Fixes #19967

    *Bernard Potocki*

109 110 111 112 113
*   Load the `default_form_builder` from the controller on initialization, which overrides
    the global config if it is present.

    *Kevin McPhillips*

114 115 116 117
*   Accept lambda as `child_index` option in `fields_for` method.

    *Karol Galanciak*

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

120
    Fixes #19640.
121 122 123

    *Adam Prescott*

124
*   `translate` should accept nils as members of the `:default`
Y
Yves Senn 已提交
125
    parameter without raising a translation missing error.
126 127 128 129 130

    Fixes #19419

    *Justin Coyne*

131 132 133 134 135 136 137
*   `number_to_percentage` does not crash with `Float::NAN` or `Float::INFINITY`
    as input when `precision: 0` is used.

    Fixes #19227.

    *Yves Senn*

138 139 140 141 142
*   Fixed the translation helper method to accept different default values types
    besides String.

    *Ulisses Almeida*

143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
*   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 已提交
163 164 165 166 167
*   Fixed a dependency tracker bug that caused template dependencies not
    count layouts as dependencies for partials.

    *Juho Leinonen*

168 169 170 171 172
*   Extracted `ActionView::Helpers::RecordTagHelper` to external gem
    (`record_tag_helper`) and added removal notices.

    *Todd Bealmear*

173
*   Allow to pass a string value to `size` option in `image_tag` and `video_tag`.
174 175 176 177 178

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

    *Mehdi Lahmam*

179 180 181 182 183 184 185 186 187 188
*   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*

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

191
    Files without a template handler in their extension will be rendered using the raw
192 193 194 195
    handler instead of ERB.

    *Rafael Mendonça França*

196 197 198 199
*   Remove deprecated `AbstractController::Base::parent_prefixes`.

    *Rafael Mendonça França*

R
Robin Dupret 已提交
200
*   Default translations that have a lower precedence than a html safe default,
201 202 203 204
    but are not themselves safe, should not be marked as html_safe.

    *Justin Coyne*

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

    *Nikolay Shebanov*

209
*   Add a `hidden_field` on the `file_field` to avoid raising an error when the only
210 211 212 213
    input on the form is the `file_field`.

    *Mauro George*

R
Robin Dupret 已提交
214 215
*   Add an explicit error message, in `ActionView::PartialRenderer` for partial
    `rendering`, when the value of option `as` has invalid characters.
216 217 218

    *Angelo Capilleri*

219
*   Allow entries without a link tag in `AtomFeedHelper`.
220 221

    *Daniel Gomez de Souza*
222

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