我很困惑,我必须在rails 3.1中放置ajax回调,触发事件beforSend,向用户显示字符串“请等一下”,并在成功发生时隐藏此字符串。
= javascript_tag "$('#form_remote').bind('ajax:beforSend', function() {$("#mess").show();});"
%div{:id => 'mess', :style=>"display:none;"} Wait,please
= form_tag filling_schedule_of_workings_path, :remote => true, :html=>{:id => 'form_remote'} do
%p{:style=>"margin:0;width:100%"}
= label_tag 'C '
= text_field_tag 'date_begin',nil,:size => 10
= label_tag 'по'
= text_field_tag 'date_end',nil,:size => 10
%br
%p{:style=>"margin:0;width:100%"}
= label_tag 'Schedule class'
= select_tag 'classifier_schedule',@classifier_schedule,:style=>"width:200px;"
%p{:style=>"margin:0;width:100%"}
= label_tag 'Schedule number'
= select_tag 'schedule_number',@schedule_number,:style=>"width:200px;"
%div{:style=>"height:25px;border-top:1px solid #CCC;margin:5px 0;"}
= submit_tag "Doing", :style => "float:right;"
这是正常的吗?
请帮忙!!