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
b748ee06
Commit
b748ee06
authored
Jul 21, 2016
by
Dean Krisitan Bardeloza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added male/female percentage functionality to candidate show page
parent
547bd4b2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
5 deletions
+8
-5
show.html.erb
Election/app/views/admin/candidates/show.html.erb
+2
-2
show.html.erb
Election/app/views/candidates/show.html.erb
+2
-2
index.html.erb
Election/app/views/pages/index.html.erb
+4
-1
mis.pdf
mis.pdf
+0
-0
No files found.
Election/app/views/admin/candidates/show.html.erb
View file @
b748ee06
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<h3>
<%=
@candidate
.
last_name
%>
's Slogan:
<%=
@candidate
.
slogan
%>
</h3>
<h3>
<%=
@candidate
.
last_name
%>
's Slogan:
<%=
@candidate
.
slogan
%>
</h3>
<ul>
<ul>
<li>
Votes:
<%=
@votes_male
.
size
+
@votes_female
.
size
%>
</li>
<li>
Votes:
<%=
@votes_male
.
size
+
@votes_female
.
size
%>
</li>
<li>
Male Voters:
<%=
@votes_male
.
size
%>
</li>
<li>
Male Voters:
<%=
@votes_male
.
size
%>
(
<%=
@votes_male
.
size
*
100
/
@votes
.
size
%>
%)
</li>
<li>
Female Voters:
<%=
@votes_female
.
size
%>
</li>
<li>
Female Voters:
<%=
@votes_female
.
size
%>
(
<%=
@votes_female
.
size
*
100
/
@votes
.
size
%>
%)
</li>
</ul>
</ul>
Election/app/views/candidates/show.html.erb
View file @
b748ee06
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
<h3>
<%=
@candidate
.
last_name
%>
's Slogan:
<%=
@candidate
.
slogan
%>
</h3>
<h3>
<%=
@candidate
.
last_name
%>
's Slogan:
<%=
@candidate
.
slogan
%>
</h3>
<ul>
<ul>
<li>
Votes:
<%=
@votes_male
.
size
+
@votes_female
.
size
%>
</li>
<li>
Votes:
<%=
@votes_male
.
size
+
@votes_female
.
size
%>
</li>
<li>
Male Voters:
<%=
@votes_male
.
size
%>
</li>
<li>
Male Voters:
<%=
@votes_male
.
size
%>
(
<%=
@votes_male
.
size
*
100
/
@votes
.
size
%>
%)
</li>
<li>
Female Voters:
<%=
@votes_female
.
size
%>
</li>
<li>
Female Voters:
<%=
@votes_female
.
size
%>
(
<%=
@votes_female
.
size
*
100
/
@votes
.
size
%>
%)
</li>
</ul>
</ul>
<h2>
People who voted for
<%=
@candidate
.
first_name
%>
<%=
@candidate
.
last_name
%>
:
</h2>
<h2>
People who voted for
<%=
@candidate
.
first_name
%>
<%=
@candidate
.
last_name
%>
:
</h2>
...
...
Election/app/views/pages/index.html.erb
View file @
b748ee06
...
@@ -23,11 +23,14 @@
...
@@ -23,11 +23,14 @@
<tr>
<tr>
<th>
Full Name
</th>
<th>
Full Name
</th>
<th>
Number of Votes
</th>
<th>
Number of Votes
</th>
</tr>
</tr>
<%
p
.
candidates
.
each
do
|
candidate
|
%>
<%
p
.
candidates
.
each
do
|
candidate
|
%>
<tr>
<tr>
<td>
<%=
link_to
"
#{
candidate
.
first_name
}
#{
candidate
.
last_name
}
"
,
candidate_path
(
candidate
.
id
)
%>
</td>
<td>
<%=
link_to
"
#{
candidate
.
first_name
}
#{
candidate
.
last_name
}
"
,
candidate_path
(
candidate
.
id
)
%>
</td>
<td>
<%=
Vote
.
where
(
candidate_id:
candidate
.
id
).
count
%>
</td>
<td>
<%=
Vote
.
where
(
candidate_id:
candidate
.
id
).
count
%>
</td>
</tr>
</tr>
<%
end
%>
<%
end
%>
</table>
</table>
...
...
mis.pdf
0 → 100644
View file @
b748ee06
File added
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