开发者

Why doesn't my sorting method get called?

开发者 https://www.devze.com 2023-03-18 14:11 出处:网络
This is my code: <table border=\"1\" id=\"champs\"> <tbody id=\"item-list-body\"> <tr class=\"champ\" id=\"view-item-<%= champ.id %>\">开发者_如何学C;

This is my code:

<table border="1" id="champs">
<tbody id="item-list-body">
<tr class="champ" id="view-item-<%= champ.id %>">开发者_如何学C;
<td class="drag_handle">[Déplacer]</td>
</tbody>
</table>
<%= sortable_element('item-list-body',:url => sort_update_path, :tag =>:tr, :handle => :drag_handle) %>

I am able to sort, but the method sort_update are never call.

I use Rails 3.0.7 and Ruby 1.9.2


It's very particular about the elements' ID's. It has to be in the format of string_integer.

Try changing to:

<tr class="champ" id="view_<%= champ.id %>">

And as mentioned, close the tr


You are not closing the tr tag. I'm also wondering how you can sort a list which includes only one item.

0

精彩评论

暂无评论...
验证码 换一张
取 消