title: rails and uploadify onError ajax call redirects to undefined action
body: <p>heres my controller action:</p>
  
  <pre><code>  def create
          #logger.debug("Time.now is #{Time.now}")
          new_params = coerce(params)
          logger.debug new_params.inspect
          params[:user] = new_params[:user] 
          @user = User.api_create(params[:user])
          logger.info @user.inspect
         # redirect_to @user
          respond_to do |format| 
            if @user.save
              format.html {redirect_to @user} 
              format.json {render :json =&gt; { :user =&gt; user_path(@user) } }
            else
              format.html {redirect_to :controller =&gt; "application", :action =&gt; "index"} 
              format.json {render :json =&gt; { :errors =&gt; "errors" } }
            end
          end
        end
  </code></pre>
  
  <p>When I have no errors, the user path is returned to uploadify onComplete. But when I try to pass a string back to onError I get redirected to </p>
  
  <blockquote>
    <p>ActionController::RoutingError (No
    route matches "/undefined"):</p>
    
    <p>Rendered
    /Users/ddayan/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb
    within rescues/layout (1.8ms)</p>
  </blockquote>
  
  <p>Any idea what am I doing wrong??</p>
  
  <p>Edit: Ok, I didn't think it through, if I render json than it goes to onComplete. So my new question is how do I return the error message to onError???? </p>
  
  <p>Edit2: So I changed the format to JS</p>
  
  <pre><code>format.js { render :text =&gt; "ERROR", :status =&gt; 403 }
  </code></pre>
  
  <p>I get the error status in the info field inside errorObj, but I don't have responseText</p>
  
  <pre><code>Object
    info: 403
    type: "HTTP"
    __proto__: Object
  </code></pre>