jquery - Detecting ajax:failure in Rails 3 forms -


i working form in rails 3 , running totally weird situation. basically, form detects successful return, fails detect "400" error. here code.

jquery:

$(".editorial_review").live('ajax:failure', function(xhr, status, error) {          alert('error');         })     .live('ajax:success', function(){$(this).parents('tr').prev('tr.main').fadeout(); $(this).parents('tr').fadeout(); });   });   

rails:

 def create     render :json => {:error => 'no final status selected'},:status => 400 , return if params[:status].blank?     @success = send(params[:status].gsub(' ', '_'))     respond_to |format|       format.js {head:ok}     end   end   

haml:

-semantic_form_for editorialreview.new, :remote=>true |f| 

i've checked in firebug, , seems kosher, , indeed when controller responds head :ok there no problems speak of.

any appreciated. thanks!

the jquery rails.js uses ajax:error instead of ajax:failure. try that


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -