1
我很困惑,我必須在rails 3.1中放置ajax回調函數,觸發事件beforSend向用戶顯示字符串「請等待」,並在出現成功時隱藏此字符串。在rails 3.1中放置ajax回調腳本代碼的位置?
= 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;"
這是正常的嗎?
請幫忙!