Skip to content

Instantly share code, notes, and snippets.

@jdkealy
Created October 12, 2011 09:57
Show Gist options
  • Save jdkealy/1280787 to your computer and use it in GitHub Desktop.
Save jdkealy/1280787 to your computer and use it in GitHub Desktop.
/* markup */
<%= content_for :sidebar do %>
<ul class="sortable">
<% @page_parts.each do |f| %>
<li id="menu_<%= f.id %>"><%= f.title %></li>
<% end %>
</ul>
<% end %>
/* jquery */
$(document).ready(function() {
$(".sortable").sortable({
update : function (){
$.ajax(
{
type: "POST",
url: "/page_parts/sort/",
data:
{
sort:$(".sortable").sortable('serialize'),
},
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment