I have a list of "tasks" and I'm using "sortable" so that a user can prioritize them, putting the most important ones on top. But of course, every time the page is refreshed they go back to their original position. I'm wondering if it's possible to save the position of the tasks?
Here's my code (it's a rails project):
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script>
$(document).ready(function() {
$('.move').sortable();
});
</script>
<%= render "form" %>
<div class="move">
<% if [email protected]? %>
<% for item in @project.tasks %>
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">
<div class='move'><%= item.title %></div>
</div>
</div>
<div class="panel-body">
<p>
<div class='move'><%= item.description %></div>
</p>
<%= link_to "Edit", edit_project_task_path(@project, item) %>
</div>
</div>
<% end %>
<% end %>
</div>