Rails.application.routes.draw do
  devise_for :users

  root to: "votes#index"
  get "/profiles", to: "votes#vote_history"
  get "/about", to: "pages#about"
  get "/index", to: "pages#index"
  resources :candidates

  get "/positions/:id", to: "positions#show"
  
  get 'candidates_list', to: 'votes#index', as: :candidates_list
  get '/vote', to: 'votes#vote', as: :vote
  post '/confirm_vote', to: 'votes#confirm_vote', as: :confirm_vote
  get '/vote_history', to: 'votes#vote_history', as: :vote_history
  
  namespace :admin do
  	resources :candidates
    resources :positions
    get "/positions/:id", to: "positions#show"
  end
end
