jquery.form does not care about status code for success or error callback

jquery.form does not care about status code for success or error callback

I submit a form to my rails controller
  1. $('#edit_form_submit').live('click', function(e) {
  2. $('#node_edit_form').ajaxSubmit({
  3. target : '#node',
  4. success: function(data, textStatus, xhr) {
  5. console.log("success");
  6. },
  7. error: function() {
  8. console.log("error");
  9. }
  10. });
  11. return false;
  12. });
I want to show the user via http-status code if the edit was success or failure but if I send back content allways the success-callback is triggered doesn't matter if http-status code is 4XX

  1. def update
  2. @node = Node.find(params[:id])
  3. @node.update_attributes(params[:node])
  4. if @node.save
  5. render :partial => 'edit', :status => :ok
  6. else
  7. render :partial => 'edit', :status => :unprocessable_entity
  8. end
  9. end
only if I revome the rendered content from the response the error callback is triggered.
is there anything else to send back from the server?

cheers Kai