voltrb / volt

A Ruby web framework where your Ruby runs on both server and client
MIT License
3.22k stars 196 forks source link

{action}_ready javascript doesn't apply to component views #271

Closed dennym closed 9 years ago

dennym commented 9 years ago

I have this in the few and it gets correctly served from the corresponding controller. That controller has a {action}_ready method with

  `$('.clickable-row').click(function() {
    console.log('clicked');
  });`

Thats the view with the table rows.

<tbody>
  <tr class="clickable-row" >
    <td>Testrow</td>
  </tr>
  {{ _objects.each do |object| }}
    <:blub:tablerow model="{{ object }}" />
  {{ end }}
</tbody>

And the component tablerow.

<:Body>
  <tr class="clickable-row" >
    <td>{{ object._data }}</td>
  </tr>

The little jquery snippet gets fired on the static tablerow but not on the component view rows. Any ideas or suggestions?