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
446866c2
Commit
446866c2
authored
Jul 19, 2016
by
April Guian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added CRUD to Positions
parent
4f024caf
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
2 deletions
+10
-2
candidates_controller.rb
Poller/app/controllers/candidates_controller.rb
+1
-1
index.html.erb
Poller/app/views/admin/positions/index.html.erb
+7
-0
index.html.erb
Poller/app/views/candidates/index.html.erb
+1
-1
profile.html.erb
Poller/app/views/users/profile.html.erb
+1
-0
No files found.
Poller/app/controllers/candidates_controller.rb
View file @
446866c2
...
...
@@ -7,7 +7,7 @@ class CandidatesController < ApplicationController
def
show
@candidate
=
Candidate
.
find
(
params
[
:id
])
#
@user = @candidate.user
@user
=
@candidate
.
user
#@users = User.all
render
"candidates/show.html.erb"
end
...
...
Poller/app/views/admin/positions/index.html.erb
View file @
446866c2
...
...
@@ -2,14 +2,21 @@
<%
@positions
.
each
do
|
c
|
%>
<h2>
(
<%=
c
.
id
%>
)
<%=
c
.
name
%>
</h2>
<%=
link_to
"Edit Position"
,
edit_admin_position_path
(
c
.
id
)
%>
<%=
link_to
"Delete Position"
,
admin_position_path
(
c
.
id
),
method: :delete
,
data:
{
confirm:
'Are you sure?'
}
%>
<ul>
<%
c
.
candidates
.
each
do
|
p
|
%>
<li>
<%=
link_to
"
#{
p
.
first_name
}
#{
p
.
last_name
}
"
,
admin_candidate_path
(
p
.
id
)
%>
</li>
<%
end
%>
</ul>
<%=
link_to
"View all Candidates under
#{
c
.
name
}
"
,
"admin/positions/
#{
c
.
id
}
"
%>
<%
end
%>
<hr>
<%=
link_to
(
"Add New Position"
,
new_admin_position_path
)
%>
<hr>
...
...
Poller/app/views/candidates/index.html.erb
View file @
446866c2
...
...
@@ -17,7 +17,7 @@
<td>
<%=
c
.
slogan
%>
</td>
<td>
<%=
c
.
position
.
name
%>
</td>
<td>
<%=
link_to
"Show"
,
position
_path
(
c
.
id
)
%>
<%=
link_to
"Show"
,
candidate
_path
(
c
.
id
)
%>
</td>
</tr>
<%
end
%>
...
...
Poller/app/views/users/profile.html.erb
0 → 100644
View file @
446866c2
<h1>
<%=
Create
a
profile
page
that
displays
all
the
candidates
that
the
user
voted
%>
</h1>
\ 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