fixed votes index

parent 68c2d345
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
<%= csrf_meta_tags %> <%= csrf_meta_tags %>
</head> </head>
<body> <body>
<style type= "text/css">
body{background-color: rgba(245, 245, 245, 0.9)}</style>
<% if user_signed_in? %> <% if user_signed_in? %>
<%= "You are logged in as: #{current_user.email}" %> &nbsp; <button type="button" class="btn btn-default"><%= link_to 'Edit Profile', edit_user_registration_path %></button> <button type="button" class="btn btn-default"><%= link_to "Log Out", destroy_user_session_path, method: :delete %></button> <%= "You are logged in as: #{current_user.email}" %> &nbsp; <button type="button" class="btn btn-default"><%= link_to 'Edit Profile', edit_user_registration_path %></button> <button type="button" class="btn btn-default"><%= link_to "Log Out", destroy_user_session_path, method: :delete %></button>
<% else %> <% else %>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="col-md-6"> <div class="col-md-6">
<%= f.association :candidate, :collection => Candidate.where(position_id: (p.id)), include_blank: false, :label_method => lambda {|candidate| "#{candidate.last_name}, #{candidate.first_name}"}, as: :radio_buttons , label: "Candidates: "%> <%= f.association :candidate, :collection => Candidate.where(position_id: (p.id)), include_blank: false, :label_method => lambda {|candidate| "#{candidate.last_name}, #{candidate.first_name}"}, as: :radio_buttons , label: "Candidates: "%>
<% Candidate.where(position_id: (p.id)).each do |candidate| %> <% Candidate.where(position_id: (p.id)).each do |candidate| %>
<p><div class="btn btn-primary btn-xs" data-toggle="popover" data-content="<%= candidate.slogan %>" style="margin-top: 2px; margin-bottom: 1px", data-trigger="focus", role="button", tabindex="0", title="<%= candidate.first_name %> <%= candidate.last_name %>"> View <%= candidate.last_name %>'s Slogan</div></p> <p>Slogan: <%= candidate.slogan %></p>
<% end -%> <% end -%>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
......
<h1>Votes</h1> <h1>Votes</h1>
<%= link_to "Vote Now!", votes_new_path %>
<table width="100%"> <table width="100%">
<tr> <tr>
<th>#</th> <th>Vote ID</th>
<th>User ID</th>
<th>Candidate</th> <th>Candidate</th>
<th>Position</th> <th>Position</th>
<th>Comments</th> <th>Comments</th>
...@@ -11,8 +9,7 @@ ...@@ -11,8 +9,7 @@
<% @votes.each do |vote| %> <% @votes.each do |vote| %>
<tr> <tr>
<td><%= link_to "#{vote.id}", vote_path(vote.id) %></td> <td><%= vote.id %></td>
<td><%= vote.user_id %></td>
<td> <td>
<%= vote.candidate.first_name %> "<%= vote.candidate.nickname %>" <%= vote.candidate.last_name %> <%= vote.candidate.first_name %> "<%= vote.candidate.nickname %>" <%= vote.candidate.last_name %>
</td> </td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment