我有以下几点:
<%= link_to my_path, method: :delete, confirm: 'Delete?', class: 'link-delete', 'data-message' => 'Are you sure?', 'data-severity' => 'danger', :remote => true do %>
<i class="icon-trash"></i>
<% end %>
这带来了一个用于确认的 bootstrap 模式,我想连接到ajax调用,以便显示微调器或某种文本.
I know that I can use unobtrusive javascript to listen to the click event like so, if I DON'T use ':remote => true' in my link_to
jQuery ->
$('.link-delete').live 'click', (event) ->
$('.link-delete').html("Loading...") #THE MSG OR ANIMATION I WANT TO DISPLAY
$.get(this.href, null, null, 'script')
false
but not sure how to combine the two when using ':remote => true'
有什么建议吗?
谢谢你的帮助