Commit 457b13e5 authored by Galen Evilla's avatar Galen Evilla

tweaks

parent 37e830e0
class PagesController < ApplicationController class PagesController < ApplicationController
def index def index
@users = User.all
@votes = Vote.all @votes = Vote.all
@candidates = Candidate.all @candidates = Candidate.all
@positions = Position.all @positions = Position.all
......
...@@ -3,12 +3,11 @@ ...@@ -3,12 +3,11 @@
<%=link_to "Add New Position", new_admin_position_path%> <%=link_to "Add New Position", new_admin_position_path%>
<hr> <hr>
<% @positions.each do |c| %> <% @positions.each do |p| %>
<h2><%= c.name %></h2> <h2><%= link_to p.name, admin_position_path(p.id) %></h2>
<ul> <ul>
<% c.candidates.each do |p| %> <% p.candidates.each do |c|%>
<li><%= link_to "#{p.first_name} #{p.last_name}" , admin_candidate_path(p.id) %></li> <li><%=link_to c.full_name, admin_candidate_path(c.id)%></li>
<% end %> <% end %>
</ul> </ul>
<% end %> <% end %>
\ No newline at end of file
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<td></td> <td></td>
<td><center><%=link_to c.full_name, admin_candidate_path(c.id)%></center></td> <td><center><%=link_to c.full_name, admin_candidate_path(c.id)%></center></td>
<td><center><%=c.votes.count%></center></td> <td><center><%=c.votes.count%></center></td>
<td><center><progress value="<%=c.votes.count%>" max="<%=total%>" >(<%=c.votes.count%>)</center></td> <td><center><progress value="<%=c.votes.count%>" max="<%=@users.count%>" >(<%=c.votes.count%>)</center></td>
</tr> </tr>
<%end%> <%end%>
</table> </table>
......
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