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
fc99cc9e
Commit
fc99cc9e
authored
Jul 18, 2016
by
Dean Krisitan Bardeloza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified show for candidates, can now show name, slogan, and voters(number of voters in progress)
parent
1eaf9d2d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
positions_controller.rb
Election/app/controllers/positions_controller.rb
+1
-1
show.html.erb
Election/app/views/admin/candidates/show.html.erb
+7
-5
No files found.
Election/app/controllers/positions_controller.rb
View file @
fc99cc9e
...
@@ -2,7 +2,7 @@ class PositionsController < ApplicationController
...
@@ -2,7 +2,7 @@ class PositionsController < ApplicationController
before_action
:authenticate_user!
before_action
:authenticate_user!
def
show
def
show
@position
=
Position
.
find
(
params
[
:id
])
@position
=
Position
.
find
(
params
[
:id
])
@candidates
=
@
candidate
.
position
s
@candidates
=
@
position
.
candidate
s
render
"positions/show.html.erb"
render
"positions/show.html.erb"
end
end
...
...
Election/app/views/admin/candidates/show.html.erb
View file @
fc99cc9e
<h
1>
Position:
<%=
@position
.
name
%>
</h1
>
<h
2>
Candidate:
<%=
@candidate
.
first_name
%>
<%=
@candidate
.
last_name
%>
</h2
>
<h
2>
Candidates:
</h2
>
<h
3>
<%=
@candidate
.
slogan
%>
</h3
>
<ul>
<ul>
<
%
@candidates
.
each
do
|
c
|
%
>
<
li>
Votes:
<%
@votes_male
.
size
+
@votes_female
.
size
%>
</li
>
<li>
<%=
link_to
"
#{
c
.
first_name
}
"
+
"
#{
c
.
last_name
}
"
,
admin_candidate_path
(
c
.
id
)
%>
</li>
<li>
Male Voters:
<%
@votes_male
.
size
%>
</li>
<
%
end
%
>
<
li>
Female Voters:
<%
@votes_female
.
size
%>
</li
>
</ul>
</ul>
<%=
link_to
"Back to Candidates"
,
admin_candidates_path
%>
\ 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