RailsCasts Pro episodes are now free!

Learn more or hide this

David Tolsma's Profile

GitHub User: davidtolsma

Comments by David Tolsma

Avatar

@IanWhalen

automatically login after signup. Add the cookies line in the save condition.

ruby
  def create
    @user = User.new(params[:user])
    if @user.save
      redirect_to root_url, :notice => "Signed up!"
      cookies[:auth_token] = @user.auth_token
    else
      flash[:notice] = "User exists."
      redirect_to sign_in_path
    end
  end