I'm trying to use Deface to add a button in a column in a table in Spree Admin. But I just can't get my CSS-like selector right. I can select the table row using a data-hook, and can select child elements (eg td, span), but can't select by a specific class (in this case, .balance_due). Am I missing something simple??
My override:
Deface::Override.new(:virtual_path => "spree/admin/orders/index",
:name => "add_capture_order_shortcut2",
:insert_bottom => "[data-hook='admin_orders_index_rows'] .balance_due",
:text => '<h1>hey yo, your balance is due</h1>'
)
I have confirmed the CSS selector using jQuery, ie:
$("[data-hook='admin_orders_index_rows'] .balance_due")
=> [<span class="state balance_due">…</span>]
An exerpt from the generated HTML:
<tr data-hook="admin_orders_index_rows" class="state-complete odd">
...
<td class="align-center"><span class="state balance_due"><a href="/admin/orders/R617712280/payments">balance due</a></span></td>
...
</tr>