diff options
Diffstat (limited to 'actionview/CHANGELOG.md')
-rw-r--r-- | actionview/CHANGELOG.md | 238 |
1 files changed, 145 insertions, 93 deletions
diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md index 3fc2ab178c..c010b7ce91 100644 --- a/actionview/CHANGELOG.md +++ b/actionview/CHANGELOG.md @@ -1,159 +1,211 @@ -* Fix that render layout: 'messages/layout' should also be added to the dependency tracker tree. +* Collection input propagates input's `id` to the label's `for` attribute when + using html options as the last element of collection. - *DHH* + *Vasiliy Ermolovich* -* Add `PartialIteration` object used when rendering collections. +* 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`. - The iteration object is available as the local variable - `#{template_name}_iteration` when rendering partials with collections. + *Mauro George* - It gives access to the `size` of the collection being iterated over, - the current `index` and two convenience methods `first?` and `last?`. +* `url_for` does not modify its arguments when generating polymorphic URLs. - *Joel Junström*, *Lucas Uyezu* + *Bernerd Schaefer* -* Return an absolute instead of relative path from an asset url in the case - of the `asset_host` proc returning nil +* `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* + +* Make `disable_with` the default behavior for submit tags. Disables the + button on submit to prevent double submits. - *Jolyon Pawlyn* + *Justin Schiff* -* Fix `html_escape_once` to properly handle hex escape sequences (e.g. ᨫ) +* Add a break_sequence option to word_wrap so you can specify a custom break. - *John F. Douthat* + * Mauricio Gomez * -* Added String support for min and max properties for date field helpers. +* Add wildcard matching to explicit dependencies. - *Todd Bealmear* + Turns: -* The `highlight` helper now accepts a block to be used instead of the `highlighter` - option. + ```erb + <% # Template Dependency: recordings/threads/events/subscribers_changed %> + <% # Template Dependency: recordings/threads/events/completed %> + <% # Template Dependency: recordings/threads/events/uncompleted %> + ``` - *Lucas Mazza* + Into: -* The `except` and `highlight` helpers now accept regular expressions. + ```erb + <% # Template Dependency: recordings/threads/events/* %> + ``` - *Jan Szumiec* + *Kasper Timm Hansen* -* Flatten the array parameter in `safe_join`, so it behaves consistently with - `Array#join`. +* Allow defining explicit collection caching using a `# Template Collection: ...` + directive inside templates. - *Paul Grayson* + *Dov Murik* -* Honor `html_safe` on array elements in tag values, as we do for plain string - values. +* Asset helpers raise `ArgumentError` when `nil` is passed as a source. - *Paul Grayson* + *Anton Kolomiychuk* -* Add `ActionView::Template::Handler.unregister_template_handler`. +* 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. - It performs the opposite of `ActionView::Template::Handler.register_template_handler`. + Fixes #20535 - *Zuhao Wan* + *Roque Pinel* -* Bring `cache_digest` rake tasks up-to-date with the latest API changes +* Improve detection of partial templates eligible for collection caching, + now allowing multi-line comments at the beginning of the template file. - *Jiri Pospisil* + *Dov Murik* -* Allow custom `:host` option to be passed to `asset_url` helper that - overwrites `config.action_controller.asset_host` for particular asset. +* Raise an ArgumentError when a false value for `include_blank` is passed to a + required select field (to comply with the HTML5 spec). - *Hubert Łępicki* + *Grey Baker* -* Deprecate `AbstractController::Base.parent_prefixes`. - Override `AbstractController::Base.local_prefixes` when you want to change - where to find views. +* Do not put partial name to `local_assigns` when rendering without + an object or a collection. - *Nick Sutterer* + *Henrik Nygren* -* Take label values into account when doing I18n lookups for model attributes. +* Remove `:rescue_format` option for `translate` helper since it's no longer + supported by I18n. - The following: + *Bernard Potocki* - # form.html.erb - <%= form_for @post do |f| %> - <%= f.label :type, value: "long" %> - <% end %> +* `translate` should handle `raise` flag correctly in case of both main and default + translation is missing. - # en.yml - en: - activerecord: - attributes: - post/long: "Long-form Post" + Fixes #19967 - Used to simply return "long", but now it will return "Long-form - Post". + *Bernard Potocki* - *Joshua Cody* +* Load the `default_form_builder` from the controller on initialization, which overrides + the global config if it is present. -* Change `asset_path` to use File.join to create proper paths: + *Kevin McPhillips* - Before: +* Accept lambda as `child_index` option in `fields_for` method. - https://some.host.com//assets/some.js + *Karol Galanciak* - After: +* `translate` allows `default: [[]]` again for a default value of `[]`. - https://some.host.com/assets/some.js + Fixes #19640. - *Peter Schröder* + *Adam Prescott* -* Change `favicon_link_tag` default mimetype from `image/vnd.microsoft.icon` to - `image/x-icon`. +* `translate` should accept nils as members of the `:default` + parameter without raising a translation missing error. - Before: + Fixes #19419 - #=> favicon_link_tag 'myicon.ico' - <link href="/assets/myicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" /> + *Justin Coyne* - After: +* `number_to_percentage` does not crash with `Float::NAN` or `Float::INFINITY` + as input when `precision: 0` is used. - #=> favicon_link_tag 'myicon.ico' - <link href="/assets/myicon.ico" rel="shortcut icon" type="image/x-icon" /> + Fixes #19227. - *Geoffroy Lorieux* + *Yves Senn* -* Remove wrapping div with inline styles for hidden form fields. +* Fixed the translation helper method to accept different default values types + besides String. - We are dropping HTML 4.01 and XHTML strict compliance since input tags directly - inside a form are valid HTML5, and the absence of inline styles help in validating - for Content Security Policy. + *Ulisses Almeida* - *Joost Baaij* +* Collection rendering automatically caches and fetches multiple partials. -* `collection_check_boxes` respects `:index` option for the hidden filed name. + Collections rendered as: - Fixes #14147. + ```ruby + <%= render @notifications %> + <%= render partial: 'notifications/notification', collection: @notifications, as: :notification %> + ``` - *Vasiliy Ermolovich* + will now read several partials from cache at once, if the template starts with a cache call: -* `date_select` helper with option `with_css_classes: true` does not overwrite other classes. + ```ruby + # notifications/_notification.html.erb + <% cache notification do %> + <%# ... %> + <% end %> + ``` - *Izumi Wong-Horiuchi* + *Kasper Timm Hansen* -* `number_to_percentage` does not crash with `Float::NAN` or `Float::INFINITY` - as input. +* Fixed a dependency tracker bug that caused template dependencies not + count layouts as dependencies for partials. - Fixes #14405. + *Juho Leinonen* - *Yves Senn* +* Extracted `ActionView::Helpers::RecordTagHelper` to external gem + (`record_tag_helper`) and added removal notices. -* Add `include_hidden` option to `collection_check_boxes` helper. + *Todd Bealmear* - *Vasiliy Ermolovich* +* 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* -* Fixed a problem where the default options for the `button_tag` helper is not - applied correctly. +* Add a `hidden_field` on the `file_field` to avoid raising an error when the only + input on the form is the `file_field`. - Fixes #14254. + *Mauro George* - *Sergey Prikhodko* +* Add an explicit error message, in `ActionView::PartialRenderer` for partial + `rendering`, when the value of option `as` has invalid characters. -* Take variants into account when calculating template digests in ActionView::Digestor. + *Angelo Capilleri* - The arguments to ActionView::Digestor#digest are now being passed as a hash - to support variants and allow more flexibility in the future. The support for - regular (required) arguments is deprecated and will be removed in Rails 5.0 or later. +* Allow entries without a link tag in `AtomFeedHelper`. - *Piotr Chmolowski, Łukasz Strzałkowski* + *Daniel Gomez de Souza* -Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/actionview/CHANGELOG.md) for previous changes. +Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionview/CHANGELOG.md) for previous changes. |