1
我最近使用jRails切换到jQuery的应用程序。我以前的RJS中99%似乎完美工作,唯一的例外是使用remote_form_tag时的loading =>回调。jrails loading remote_form_tag rails
<% form_remote_tag :url => '/hostels/update_currency', :loading => visual_effect(:appear, :load_currency), :html => { :id => 'currency' } do %>
我有使用所提供的原型佣工
http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html#M001648
但使用新jRails替代之前的工作完美隐藏DIV #load_currency,这个功能似乎并没有工作?
我尝试使用RJS和jQuery直接:
:loading => visual_effect(:appear, :load_currency)
:loading => "$('#load_currency').show();"
其产品这在html:
onsubmit="jQuery.ajax({beforeSend:function(request){jQuery("#load_currency").fadeIn();}, data:jQuery.param(jQuery(this).serializeArray()) + '&authenticity_token=' + encodeURIComponent('O7Y7wzFoPPxGSTxIb2bQ3zshrUP+h1OGAUdtyzdQz0A='), dataType:'script', type:'post', url:'/hostels/update_currency'}); return false;">
我也试过回调:前和:不是后:加载和也得到了没什么...有什么想法?或者这个功能是否不适用于jRails?
谢谢