title: Double render error when trying to auto sign in and redirect user into a specific path after registration in Devise
body: <p>Hi I am getting a double redirection here</p>
  
  <p>What I've been trying to accomplish is to auto sign in the user and redirect the user into a specific path, not in the root path.</p>
  
  <p>In my registrations_controller.rb</p>
  
  <pre><code>def new
      @user = User.new
    end
  
    def create
      @user = User.new params[:user]
      @valid = @user.save
      if @valid
        sign_up
      end
      respond_to do |format|
        format.js { render layout: false }
      end
    end
  
    def sign_up
      sign_in(resource_name, resource)
      respond_with resource, :location =&gt; after_sign_up_path_for(resource)
    end
  </code></pre>
  
  <p>In my application_controller.rb</p>
  
  <pre><code>def after_sign_in_path_for(resource)
      if resource.admin? or resource.super_admin?
        admin_index_path      
      else
        if mobile_device?
          page_path("backgroundinfo")
        else
          page_path("howto")
        end
      end
    end
  
    def after_sign_up_path_for(resource)
      page_path("howto")
    end
  </code></pre>
  
  <p>Any workarounds will be appreciated.</p>
  
  <p>PS: Removing the <code>respond_with resource, :location =&gt; after_sign_up_path_for(resource)</code> is still redirecting the user to the <code>root_path</code> not in the <code>page_path</code> maybe because the controller action is in registration?</p>