Commit 2920b041 authored by Galen Evilla's avatar Galen Evilla

formats

parent 8142eeb2
module Users module Users
class UsersController < ApplicationController class UsersController < ApplicationController
before_action :authenticate_user! before_action :authenticate_user!
def index def index
@positions = Position.all @positions = Position.all
@candidates = Candidate.all @candidates = Candidate.all
@votes = Vote.all @votes = Vote.all
render "pages/profile.html.erb" render "pages/profile.html.erb"
end end
end end
end end
...@@ -2,19 +2,32 @@ ...@@ -2,19 +2,32 @@
<% provide(:title, "Candidates") %> <% provide(:title, "Candidates") %>
<center> <center>
<h1>CANDIDATES</h1> <h1>CANDIDATES</h1>
<%=link_to "Add a candidate", new_admin_candidate_path%> <%=link_to "Add a candidate", new_admin_candidate_path%>
</center> </center>
<hr> <hr>
<% @positions.each do |p| %> <%@positions.each do |p|%>
<div class ="section">
<h3><%= p.name %></h3> <div class ="box">
<ul> <h4><center><%=p.name%></center></h4>
<% p.candidates.each do |c|%> <table>
<li><%=link_to c.full_name, admin_candidate_path(c.id)%></li> <thead>
<% end %> <th><center>&nbsp;</center></th>
</ul> <th><center>Name</center></th>
<th><center>Slogan</center></th>
<th><center>&nbsp;</center></th>
</thead>
<%p.candidates.each do |c|%>
<tr>
<td></td>
<td><center><%=link_to c.full_name, admin_candidate_path(c.id)%></center></td>
<td><center><%=c.slogan%></center></td>
</tr>
<%end%>
</table>
</div>
</div>
<% end %> <% end %>
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