Skip to content

Instantly share code, notes, and snippets.

@Znow
Created April 27, 2012 08:01
Show Gist options
  • Save Znow/2507235 to your computer and use it in GitHub Desktop.
Save Znow/2507235 to your computer and use it in GitHub Desktop.
<tr>
<td>
<%= check_box_tag "completed", t.id, t.completed, :class => "completed" %>
</td>
<td><%= t.task_type %></td>
<td><%= link_to "#{truncate(t.subject, :length => 20)}", admin_task_path(t) %></td>
<td><%= t.responsible(&:name) %></td>
<td><%= link_to t.client, admin_client_path(t.client) unless t.client.nil? %></td>
<td><%= t.deadline.strftime("%d/%m/%y %H:%M") %></td>
<td><%= t.author(&:name) %></td>
<td>
<a data-toggle="modal" href="#editTask<%= t.id %>"><%= image_tag "edit.png" %></a>
<a data-toggle="modal" href="#deleteTask<%= t.id %>"><%= image_tag "delete.png" %></a>
</td>
</tr>
<script>
$(".completed").live("change", function('<%= t %>') {
$.ajax({
url: "/admin/tasks/completed",
beforeSend: function() { alert("Hi"+'<%= t %>') },
data: "id="+'<%= t %>',
success: function() { alert('Bye') }
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment