class VotesController < ApplicationController

  def new
    if flash[:prev_winner_id]
      @prev_winner = Artist.find(flash[:prev_winner_id])
      @prev_loser = Artist.find(flash[:prev_loser_id])
      scores = Artist.score
      rankings = Artist.ranking
      @prev_winner_score = scores[@prev_winner.id]
      @prev_loser_score = scores[@prev_loser.id]
      @prev_winner_ranking = rankings[@prev_winner.id]
      @prev_loser_ranking = rankings[@prev_loser.id]
    end
    @option1 = Artist.get_random_artist
    @option2 = Artist.get_random_artist
    until @option1 != @option2
      @option2 = Artist.get_random_artist
    end
    @vote = Vote.new()
  end

  def create
    @vote = Vote.new(winner_id: params[:winner], loser_id: params[:loser], user_id: session[:user_id])
    flash[:prev_winner_id] = params[:winner]
    flash[:prev_loser_id] = params[:loser]
    if @vote.save
      redirect_to root_path
    else
      render new
    end
  end
end

class VotesController < ApplicationController

  def new
    if flash[:prev_winner_id]
      @prev_winner = Artist.find(flash[:prev_winner_id])
      @prev_loser = Artist.find(flash[:prev_loser_id])
      scores = Artist.score
      rankings = Artist.ranking
      @prev_winner_score = scores[@prev_winner.id]
      @prev_loser_score = scores[@prev_loser.id]
      @prev_winner_ranking = rankings[@prev_winner.id]
      @prev_loser_ranking = rankings[@prev_loser.id]
    end

    if !session[:next_pairs] #first visit
      pair = Artist.get_artist_pair
      @option1 = pair[0]
      @option2 = pair[1]
    else #other visits
      @option1 =  Artist.find(session[:next_pairs][0])
      @option2 = Artist.find(session[:next_pairs][1])
    end
      session_pair = Artist.get_artist_pair
      session[:next_pairs] = [session_pair[0].id, session_pair[1].id]
    @vote = Vote.new()
  end

  def create
    @vote = Vote.new(winner_id: params[:winner], loser_id: params[:loser], user_id: session[:user_id])
    flash[:prev_winner_id] = params[:winner]
    flash[:prev_loser_id] = params[:loser]
    if @vote.save
      redirect_to root_path
    else
      render new
    end
  end
end

Add logic to find next pair of votes
Add logic to find next pair of votes
