Skip to content

Unbind event after partial is fetched

Compare
Choose a tag to compare
@nikolalsvk nikolalsvk released this 11 Nov 08:12
· 102 commits to master since this release

This release solves #94 and allows you to unbind an event when using toggle functionality of the gem.

You can unbind an event by passing once: true argument to render_async toggle option:

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