Use data-aspect_id, because integer html ids freak me out.

This commit is contained in:
Raphael Sofaer 2011-07-28 15:51:00 -07:00
parent ee95def580
commit 8ce5e72519
2 changed files with 3 additions and 3 deletions

View file

@ -11,7 +11,7 @@
%ul.sub_nav
- for aspect in all_aspects
%li{:id => aspect.id, :class => ("active" if params["a_id"].to_i == aspect.id)}
%li{:data => {:aspect_id => aspect.id}, :class => ("active" if params["a_id"].to_i == aspect.id)}
.edit
= link_to image_tag("icons/pencil.svg", :height => 12), edit_aspect_path(aspect), :rel => "facebox"

View file

@ -5,9 +5,9 @@
$(document).ready(function() {
$('#aspect_nav.left_nav .all_aspects .sub_nav').sortable({
items: 'li[id]',
items: "li[data-aspect_id]",
update: function(event, ui) {
var order = $(this).sortable('toArray'),
var order = $(this).sortable("toArray", {attribute: "data-aspect_id"}),
obj = { 'reorder_aspects': order, '_method': 'put' };
$.ajax('/user', { type: 'post', dataType: 'script', data: obj });
},