Hi folks,
I have an interesting issue: I have a order model where I change the
edit-form to display the associated line items,
like you would expect a basket to look like in a web shop. (I removed some
td's because of irrelevance)
<extend tag="form" for="Order">
<old-form merge>
<field-list: fields="lineitems">
<lineitems-field:>
<table class="table">
<thead>
<tr>
<th>Amount</th>
<th>Deccription</th>
<th></th>
</tr>
</thead>
<tbody part="lineitems">
<tr repeat>
<td><input:amount class="input-mini"/></td>
<td><view:description/></td>
<td>*<delete-button update="lineitems" class="btn btn-danger
btn-small"/>*</td>
</tr>
</tbody>
</table>
</lineitems-field:>
</field-list:>
</old-form>
</extend>
I originally started with *<delete-button class="btn btn-danger
btn-small"/>* and was excited to see the magic ajax feature,
but it was not updating the page (just the database). So I helped with
specifying update and part, and the part updates ...
... on all delete buttons but the first.
There I get even an error, because it tries to delete the order record
instead of the lineitem.
Looking in the code shows me the working delete-buttons are wrapped in a
form:
> <form action="/lineitems/34" class="form-horizontal button_to"
> data-rapid-context="lineitem:34"
> data-rapid="{"form":{"ajax_attrs":{"update":"lineitems","confirm":"Sind
>
> Sie sich sicher?"}}}" method="post"><div class="hidden-fields"><input
> id="_method" name="_method" type="hidden" value="DELETE"><input
> id="page_path" name="page_path" type="hidden"
> value="/orders/131-bestellung-vom-sonntag-19-januar-2014/edit"><input
> name="authenticity_token" type="hidden"
> value="TB4uSnB0Cf12nTE4bgTQjk1iQwToYlMhnYHXUyjCuKE="></div><input
> class="btn btn-danger btn-small button delete-button
> delete-lineitem-button" type="submit" value="Entfernen"></form>
while the first one isn't:
> <input class="btn btn-danger btn-small button delete-button
> delete-lineitem-button" type="submit" value="Entfernen">
I don't treat the first one in my code in a special way, it's just a
repeat, so i looked in the source for delete-button, but I got no clues
there...
Any ideas, where i should go/look next? Or am I doing something wrong here?
Cheers,
Stefan
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/groups/opt_out.