<link rel"stylesheet" type="text/css" href="application.css">

<h1>Ballot</h1>

<% @candidates.each do |position_id, candidates| %>
<%= simple_form_for(@vote, url: "/election/vote/id:", method: :get) do |o| %>
		
			<%= Position.find(position_id).name %>
				<ul> 
					<li><%= o.association :candidate, :collection => candidates %></li>
				</ul>
				
				<% if current_user.votes.count >= Position.count %>
					<% link_to "Home", root_path %>
				<% else %>
					<%= o.button :submit, "Vote" %>
				<% end %>
		<% end %>
		<%= link_to "Back to Home", candidates_list_path %>
		
<% end %>

