当按下 div(刷新)时,我尝试刷新 div(容器)。
这是我的index.html.erb
:
<div id="Container">
<ul id="sortable1" class="connectedSortable">
<% @tasks_worker_todo.each do |task| %>
<li class="ui-state-default">
<div id="refresh"><%= best_in_place task, :done, :classes => 'highlight_on_success', type: :checkbox,collection: %w[No Yes] %></div> |
<%= task.admin_mail %> |
<%= task.task %>
</li>
<% end %>
</ul>
<br><br>
<ul id="sortable2" class="connectedSortable">
<% @tasks_worker_done.each do |task| %>
<li class="ui-state-highlight">
<%= best_in_place task, :done,:classes => 'highlight_on_success', type: :checkbox, collection: %w[No Yes] %> |
<%= task.admin_mail %> |
<%= task.task %>
</li>
<% end %>
</ul>
</div>
这就是我在我的尝试application.js
:
$(document).ready(function() {
$("#refresh").bind("click", function() {
$("#Container").reload()
});
});
请帮忙..