## Rails 7.1.4.2 (October 23, 2024) ## * No changes. ## Rails 7.1.4.1 (October 15, 2024) ## * No changes. ## Rails 7.1.4 (August 22, 2024) ## * Action View Test Case `rendered` memoization. *Sean Doyle* * Restore the ability for templates to return any kind of object and not just strings *Jean Boussier* * Fix threading issue with strict locals. *Robert Fletcher* ## Rails 7.1.3.4 (June 04, 2024) ## * No changes. ## Rails 7.1.3.3 (May 16, 2024) ## * No changes. ## Rails 7.1.3.2 (February 21, 2024) ## * No changes. ## Rails 7.1.3.1 (February 21, 2024) ## * No changes. ## Rails 7.1.3 (January 16, 2024) ## * Better handle SyntaxError in Action View. *Mario Caropreso* * Fix `word_wrap` with empty string. *Jonathan Hefner* * Rename `ActionView::TestCase::Behavior::Content` to `ActionView::TestCase::Behavior::RenderedViewContent`. Make `RenderedViewContent` inherit from `String`. Make private API with `:nodoc:`. *Sean Doyle* * Fix detection of required strict locals. Further fix `render @collection` compatibility with strict locals *Jean Boussier* ## Rails 7.1.2 (November 10, 2023) ## * Fix the `number_to_human_size` view helper to correctly work with negative numbers. *Earlopain* * Automatically discard the implicit locals injected by collection rendering for template that can't accept them When rendering a collection, two implicit variables are injected, which breaks templates with strict locals. Now they are only passed if the template will actually accept them. *Yasha Krasnou*, *Jean Boussier* * Fix `@rails/ujs` calling `start()` an extra time when using bundlers *Hartley McGuire*, *Ryunosuke Sato* * Fix the `capture` view helper compatibility with HAML and Slim When a blank string was captured in HAML or Slim (and possibly other template engines) it would instead return the entire buffer. *Jean Boussier* ## Rails 7.1.1 (October 11, 2023) ## * Updated `@rails/ujs` files to ignore certain data-* attributes when element is contenteditable. This fix was already landed in >= 7.0.4.3, < 7.1.0. [[CVE-2023-23913](https://github.com/advisories/GHSA-xp5h-f8jf-rc8q)] *Ryunosuke Sato* ## Rails 7.1.0 (October 05, 2023) ## * No changes. ## Rails 7.1.0.rc2 (October 01, 2023) ## * No changes. ## Rails 7.1.0.rc1 (September 27, 2023) ## * Introduce `ActionView::TestCase.register_parser` ```ruby register_parser :rss, -> rendered { RSS::Parser.parse(rendered) } test "renders RSS" do article = Article.create!(title: "Hello, world") render formats: :rss, partial: article assert_equal "Hello, world", rendered.rss.items.last.title end ``` By default, register parsers for `:html` and `:json`. *Sean Doyle* ## Rails 7.1.0.beta1 (September 13, 2023) ## * Fix `simple_format` with blank `wrapper_tag` option returns plain html tag By default `simple_format` method returns the text wrapped with `
`. But if we explicitly specify the `wrapper_tag: nil` in the options, it returns the text wrapped with `<>>` tag. Before: ```ruby simple_format("Hello World", {}, { wrapper_tag: nil }) # <>Hello World> ``` After: ```ruby simple_format("Hello World", {}, { wrapper_tag: nil }) #
Hello World
``` *Akhil G Krishnan*, *Junichi Ito* * Don't double-encode nested `field_id` and `field_name` index values Pass `index: @options` as a default keyword argument to `field_id` and `field_name` view helper methods. *Sean Doyle* * Allow opting in/out of `Link preload` headers when calling `stylesheet_link_tag` or `javascript_include_tag` ```ruby # will exclude header, even if setting is enabled: javascript_include_tag("http://example.com/all.js", preload_links_header: false) # will include header, even if setting is disabled: stylesheet_link_tag("http://example.com/all.js", preload_links_header: true) ``` *Alex Ghiculescu* * Stop generating `Link preload` headers once it has reached 1KB. Some proxies have trouble handling large headers, but more importantly preload links have diminishing returns so it's preferable not to go overboard with them. If tighter control is needed, it's recommended to disable automatic generation of preloads and to generate them manually from the controller or from a middleware. *Jean Boussier* * `simple_format` helper now handles a `:sanitize_options` - any extra options you want appending to the sanitize. Before: ```ruby simple_format("Continue") # => "" ``` After: ```ruby simple_format("Continue", {}, { sanitize_options: { attributes: %w[target href] } }) # => "" ``` *Andrei Andriichuk* * Add support for HTML5 standards-compliant sanitizers, and default to `Rails::HTML5::Sanitizer` in the Rails 7.1 configuration if it is supported. Action View's HTML sanitizers can be configured by setting `config.action_view.sanitizer_vendor`. Supported values are `Rails::HTML4::Sanitizer` or `Rails::HTML5::Sanitizer`. The Rails 7.1 configuration will set this to `Rails::HTML5::Sanitizer` when it is supported, and fall back to `Rails::HTML4::Sanitizer`. Previous configurations default to `Rails::HTML4::Sanitizer`. *Mike Dalessio* * `config.dom_testing_default_html_version` controls the HTML parser used by `ActionView::TestCase#document_root_element`, which creates the DOM used by the assertions in Rails::Dom::Testing. The Rails 7.1 default configuration opts into the HTML5 parser when it is supported, to better represent what the DOM would be in a browser user agent. Previously this test helper always used Nokogiri's HTML4 parser. *Mike Dalessio* * Add support for the HTML picture tag. It supports passing a String, an Array or a Block. Supports passing properties directly to the img tag via the `:image` key. Since the picture tag requires an img tag, the last element you provide will be used for the img tag. For complete control over the picture tag, a block can be passed, which will populate the contents of the tag accordingly. Can be used like this for a single source: ```erb <%= picture_tag("picture.webp") %> ``` which will generate the following: ```html