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
2920b041
Commit
2920b041
authored
Jul 20, 2016
by
Galen Evilla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
formats
parent
8142eeb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
18 deletions
+29
-18
users_controller.rb
Halalan/app/controllers/users/users_controller.rb
+7
-9
index.html.erb
Halalan/app/views/admin/candidates/index.html.erb
+22
-9
No files found.
Halalan/app/controllers/users/users_controller.rb
View file @
2920b041
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
Halalan/app/views/admin/candidates/index.html.erb
View file @
2920b041
...
@@ -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>
</center></th>
</ul>
<th><center>
Name
</center></th>
<th><center>
Slogan
</center></th>
<th><center>
</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
%>
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