create

in cloud-sql/postgres/activerecord/app/controllers/votes_controller.rb [24:37]


  def create
    
    @vote = Vote.new candidate: candidate

    
    
    if @vote.save
      render json: "Vote successfully cast for \"#{@vote.candidate}\" at #{@vote.time_cast} PST!"
    else
      render json: @vote.errors, status: :unprocessable_entity
    end
    
  end