开发者

Why doesn't my sorting method get called?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜