Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
final_project
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
evilla_gomez_guian_principe
final_project
Commits
0f4f790b
Commit
0f4f790b
authored
Jul 21, 2016
by
Justin Bala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak
parent
b2a4d135
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
Gemfile.lock
Halalan-FINAL/Gemfile.lock
+1
-1
candidate.rb
Halalan-FINAL/app/models/candidate.rb
+2
-2
show.html.erb
Halalan-FINAL/app/views/admin/candidates/show.html.erb
+2
-2
No files found.
Halalan-FINAL/Gemfile.lock
View file @
0f4f790b
...
...
@@ -190,4 +190,4 @@ DEPENDENCIES
web-console
BUNDLED WITH
1.1
0.4
1.1
2.5
Halalan-FINAL/app/models/candidate.rb
View file @
0f4f790b
...
...
@@ -18,8 +18,8 @@ class Candidate < ApplicationRecord
votes
.
select
{
|
vote
|
vote
.
user
.
gender
==
'Female'
}
end
def
other
s
_votes
votes
.
select
{
|
vote
|
vote
.
user
.
gender
==
'Other
s
'
}
def
other_votes
votes
.
select
{
|
vote
|
vote
.
user
.
gender
==
'Other'
}
end
end
Halalan-FINAL/app/views/admin/candidates/show.html.erb
View file @
0f4f790b
...
...
@@ -40,7 +40,7 @@
<tr>
<td><center>
<%=
@candidate
.
male_votes
.
size
%>
Votes
<br>
<progress
value=
"
<%=
@candidate
.
male_votes
.
size
%>
"
max=
"
<%=
@candidate
.
votes
.
count
%>
"
></center></td>
<td><center>
<%=
@candidate
.
female_votes
.
size
%>
Votes
<br>
<progress
value=
"
<%=
@candidate
.
female_votes
.
size
%>
"
max=
"
<%=
@candidate
.
votes
.
count
%>
"
></center></td>
<td><center>
<%=
@candidate
.
other
s_votes
.
size
%>
Votes
<br>
<progress
value=
"
<%=
@candidate
.
others
_votes
.
size
%>
"
max=
"
<%=
@candidate
.
votes
.
count
%>
"
></center></td>
<td><center>
<%=
@candidate
.
other
_votes
.
size
%>
Votes
<br>
<progress
value=
"
<%=
@candidate
.
other
_votes
.
size
%>
"
max=
"
<%=
@candidate
.
votes
.
count
%>
"
></center></td>
<td><center>
<%=
@candidate
.
votes
.
count
%>
</center></td>
</tr>
</table>
...
...
@@ -51,7 +51,7 @@
<ul>
<li>
<%
@candidate
.
votes
.
each
do
|
v
|
%>
<%=
"
#{
v
.
user_id
}
"
%>
Voter ID:
<%=
"
#{
v
.
user_id
}
"
%>
<br>
<p>
Comments:
<%=
v
.
comment
%>
...
...
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