render_async v2.1.1 Release Notes

Release Date: 2019-08-16 // over 2 years ago
  • ๐Ÿ†• New release (2.1.1) let's you toggle when render_async gets loaded on the page.

    By passing in a toggle hash, you can trigger render_async by clicking or doing other things to HTML elements.
    You can trigger render_async by doing something like this:

    <a href='#' id='detail-button'>detail</a>
    <%= render_async comments_path, toggle: { selector: '#detail-button', event: :click } %>

    This will trigger render_async to load when the user clicks the "detail" link on the page. render_async won't load until that event is triggered.


    If you've been using html_options as a second argument when calling render_async, you will have to change it to using a html_options hash like this:

    \<%= render\_async users\_path, html\_options: { nonce: 'lWaaV6eYicpt+oyOfcShYINsz0b70iR+Q1mohZqNaag=' } %\>