mardi 22 décembre 2015

Clicking Edit button on first record in view does not Get

I have a view with 2 buttons as follows:

<td>
  <div style="float: left; width: auto;">
    <%= button_to 'Edit', edit_jobitem_path(:id => p.id), :method => :get %>
  </div>
 <%= button_to 'Destroy', p, :method => :delete, data: { confirm: 'Are you sure?' } %>
</td>

Both buttons work fine, with one very strange exception: The Edit button on the first record Posts (the parent Jobs record) instead of Gets (the child JobItems record).

Any ideas what could be happening here?

Thanks!

Aucun commentaire:

Enregistrer un commentaire