Skip to content

JS event binding + Progressive render #33

@leoplct

Description

@leoplct

This gem is fantastic!
The only issue I have is to trigger a Jquery callback on a button click. This code below doesn't work because when the page is loaded Jquery doesn't found the "button.card" because it has not been loaded by progressive_render yet. How can I make it work?

 <%=progressive_render do %>
  <button class="card" />
<% end %>

$('.card').on('click', function(){
     THIS NEVER GET TRIGGERED
  })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions