Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MIS21FinalsElection
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dean Krisitan Bardeloza
MIS21FinalsElection
Commits
db7fe67b
Commit
db7fe67b
authored
Jul 19, 2016
by
Alfonso Gabriel R. Arvisu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created a Votes page
parent
670ee722
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
2 deletions
+29
-2
votes_controller.rb
Election/app/controllers/votes_controller.rb
+4
-0
index.html.erb
Election/app/views/pages/index.html.erb
+3
-2
index.html.erb
Election/app/views/votes/index.html.erb
+22
-0
No files found.
Election/app/controllers/votes_controller.rb
View file @
db7fe67b
class
VotesController
<
ApplicationController
def
index
@votes
=
Vote
.
all
render
"votes/index.html.erb"
end
end
\ No newline at end of file
Election/app/views/pages/index.html.erb
View file @
db7fe67b
...
...
@@ -2,8 +2,9 @@
<%
if
user_signed_in?
%>
<h2>
Please take a look at our candidates!
</h2>
<hr>
<%=
link_to
"Manage Candidates"
,
admin_candidates_path
%>
<%=
link_to
"Manage Positions"
,
admin_positions_path
%>
<%=
link_to
"Manage Candidates"
,
admin_candidates_path
%>
||
<%=
link_to
"Manage Positions"
,
admin_positions_path
%>
||
<%=
link_to
"Manage Votes"
,
votes_path
%>
<hr>
<%
@positions
.
each
do
|
p
|
%>
<h2>
(
<%=
p
.
id
%>
.)
<%=
p
.
name
%>
</h2>
...
...
Election/app/views/votes/index.html.erb
0 → 100644
View file @
db7fe67b
<h1>
Votes
</h1>
<table
width=
"100%"
>
<tr>
<th>
#
</th>
<th>
User ID
</th>
<th>
Candidate
</th>
<th>
Position
</th>
</tr>
<%
@votes
.
each
do
|
vote
|
%>
<tr>
<td>
<%=
link_to
"
#{
vote
.
id
}
"
,
vote_path
(
vote
.
id
)
%>
</td>
<td>
<%=
vote
.
user_id
%>
</td>
<td>
<%=
vote
.
candidate
.
first_name
%>
"
<%=
vote
.
candidate
.
nickname
%>
"
<%=
vote
.
candidate
.
last_name
%>
</td>
<td>
<%=
vote
.
candidate
.
position
.
name
%>
</td>
</tr>
<%
end
%>
</table>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment