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
72ce6b7b
Commit
72ce6b7b
authored
Jul 18, 2016
by
Galen Evilla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added something
parent
1a27fac1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
8 deletions
+15
-8
candidate.rb
trial-galen/Poller/app/models/candidate.rb
+1
-0
_form.html.erb
trial-galen/Poller/app/views/candidates/_form.html.erb
+4
-4
show.html.erb
trial-galen/Poller/app/views/candidates/show.html.erb
+5
-0
_form.html.erb
trial-galen/Poller/app/views/positions/_form.html.erb
+1
-1
index.html.erb
trial-galen/Poller/app/views/positions/index.html.erb
+2
-2
show.html.erb
trial-galen/Poller/app/views/positions/show.html.erb
+2
-1
No files found.
trial-galen/Poller/app/models/candidate.rb
View file @
72ce6b7b
class
Candidate
<
ApplicationRecord
class
Candidate
<
ApplicationRecord
validates
:first_name
,
presence:
true
,
uniqueness:
true
validates
:first_name
,
presence:
true
,
uniqueness:
true
validates
:last_name
,
presence:
true
validates
:last_name
,
presence:
true
validates
:slogan
,
presence:
true
,
uniqueness:
true
belongs_to
:position
belongs_to
:position
#belongs_to :user
#belongs_to :user
...
...
trial-galen/Poller/app/views/candidates/_form.html.erb
View file @
72ce6b7b
<%=
simple_form_for
@candidate
do
|
f
|
%>
<%=
simple_form_for
@candidate
do
|
f
|
%>
<%=
f
.
input
:first_name
%>
<%=
f
.
input
:first_name
,
label:
'First Name: '
%>
<%=
f
.
input
:last_name
%>
<%=
f
.
input
:last_name
,
label:
'Last Name: '
%>
<%=
f
.
input
:slogan
%>
<%=
f
.
input
:slogan
,
label:
'Slogan: '
%>
<%=
f
.
association
:position
%>
<%=
f
.
association
:position
,
label:
'Position: '
%>
<%=
f
.
submit
%>
<%=
f
.
submit
%>
<%
end
%>
<%
end
%>
trial-galen/Poller/app/views/candidates/show.html.erb
View file @
72ce6b7b
<h1>
<%=
@candidate
.
first_name
%>
<%=
@candidate
.
last_name
%>
</h1>
<h1>
<%=
@candidate
.
first_name
%>
<%=
@candidate
.
last_name
%>
</h1>
<h3>
Position:
<%=
@candidate
.
position
.
name
%>
</h3>
<h3>
Slogan:
</h3>
<p>
<%=
@candidate
.
slogan
%>
</p>
<hr>
<hr>
<%=
link_to
"Back to Candidates"
,
candidates_path
%>
<%=
link_to
"Back to Candidates"
,
candidates_path
%>
trial-galen/Poller/app/views/positions/_form.html.erb
View file @
72ce6b7b
<%=
simple_form_for
(
@position
)
do
|
f
|
%>
<%=
simple_form_for
(
@position
)
do
|
f
|
%>
<%=
f
.
input
:name
%>
<%=
f
.
input
:name
,
label:
'Position Name: '
%>
<%=
f
.
submit
%>
<%=
f
.
submit
%>
<%
end
%>
<%
end
%>
trial-galen/Poller/app/views/positions/index.html.erb
View file @
72ce6b7b
<h1>
Positions
</h1>
<h1>
Positions
</h1>
<%=
link_to
(
"New Position"
,
new_position_path
)
%>
<%=
link_to
(
"
Add
New Position"
,
new_position_path
)
%>
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<h2>
(
<%=
c
.
id
%>
)
<%=
c
.
name
%>
</h2>
<h2>
(
<%=
c
.
id
%>
)
<%=
c
.
name
%>
</h2>
<ul>
<ul>
<%
c
.
candidates
.
each
do
|
p
|
%>
<%
c
.
candidates
.
each
do
|
p
|
%>
<li>
<%=
link_to
p
.
last_name
,
candidate_path
(
p
.
id
)
%>
</li>
<li>
<%=
link_to
"
#{
p
.
first_name
}
#{
p
.
last_name
}
"
,
candidate_path
(
p
.
id
)
%>
</li>
<%
end
%>
<%
end
%>
</ul>
</ul>
<%=
link_to
"View all Candidates under
#{
c
.
name
}
"
,
"/positions/
#{
c
.
id
}
"
%>
<%=
link_to
"View all Candidates under
#{
c
.
name
}
"
,
"/positions/
#{
c
.
id
}
"
%>
...
...
trial-galen/Poller/app/views/positions/show.html.erb
View file @
72ce6b7b
...
@@ -3,10 +3,11 @@
...
@@ -3,10 +3,11 @@
<h2>
Candidates:
</h2>
<h2>
Candidates:
</h2>
<ul>
<ul>
<%
@candidates
.
each
do
|
p
|
%>
<%
@candidates
.
each
do
|
p
|
%>
<li>
<%=
link_to
p
.
last_name
,
candidate_path
(
p
.
id
)
%>
</li>
<li>
<%=
link_to
"
#{
p
.
first_name
}
#{
p
.
last_name
}
"
,
candidate_path
(
p
.
id
)
%>
</li>
<%
end
%>
<%
end
%>
</ul>
</ul>
<%=
link_to
"Add New Candidate"
,
new_candidate_path
%>
<hr>
<hr>
<%=
link_to
"Back to Positions"
,
positions_path
%>
<%=
link_to
"Back to Positions"
,
positions_path
%>
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