Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
veNJOB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thanh Hung Pham
veNJOB
Commits
d3967d64
Commit
d3967d64
authored
Jul 07, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show job
parent
b784e14a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
1 deletions
+46
-1
app/controllers/jobs_controller.rb
+4
-0
app/views/cities/show.html.erb
+1
-1
app/views/jobs/show.html.erb
+40
-0
config/routes.rb
+1
-0
No files found.
app/controllers/jobs_controller.rb
View file @
d3967d64
...
@@ -3,4 +3,8 @@ class JobsController < ApplicationController
...
@@ -3,4 +3,8 @@ class JobsController < ApplicationController
@applied_jobs
=
Apply
.
where
(
user_id:
current_user
.
id
)
@applied_jobs
=
Apply
.
where
(
user_id:
current_user
.
id
)
render
:applied_jobs
render
:applied_jobs
end
end
def
show
@jobs
=
Job
.
all
.
limit
(
5
)
end
end
end
app/views/cities/show.html.erb
View file @
d3967d64
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<%-
get_city_by_area
(
area
).
each
do
|
city
|
-%>
<%-
get_city_by_area
(
area
).
each
do
|
city
|
-%>
<%-
if
city
.
job
.
count
>
0
-%>
<%-
if
city
.
job
.
count
>
0
-%>
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
<%=
city
.
name
%>
<%=
link_to
city
.
name
,
jobs_show_path
(
city
.
id
)
%>
(
<%=
pluralize
(
city
.
job
.
count
,
'job'
)
%>
)
(
<%=
pluralize
(
city
.
job
.
count
,
'job'
)
%>
)
</div>
</div>
<%-
end
-%>
<%-
end
-%>
...
...
app/views/jobs/show.html.erb
0 → 100644
View file @
d3967d64
<%-
provide
(
:title
,
'Job list'
)
-%>
<div
class=
"well"
>
</div>
<div
class=
"well"
>
<div
class=
"row"
>
<div
class=
"col-md-2"
>
<p>
Total:
<%=
@job_count
%>
</p>
</div>
<div
class=
"col-md-6"
>
<p>
Result for:
<%=
@search_conditions
%>
</p>
</div>
</div>
<div
class=
"row"
>
Paging top
</div>
<%-
@jobs
.
each
do
|
job
|
-%>
<div
class=
"row"
>
<div
class=
"col-md-9"
>
<%=
job
.
name
%>
<%=
truncate
(
job
.
description
,
length:
250
)
%>
<%=
job
.
city
.
name
unless
job
.
city
.
nil?
%>
<%=
job
.
salary
%>
</div>
<div
class=
"col-md-3"
>
<%=
link_to
'Favorite'
,
jobs_favorite_path
%>
</div>
</div>
<%-
end
-%>
<div
class=
"row"
>
Paging bottom
</div>
</div>
config/routes.rb
View file @
d3967d64
...
@@ -5,6 +5,7 @@ Rails.application.routes.draw do
...
@@ -5,6 +5,7 @@ Rails.application.routes.draw do
get
'/cities'
,
to:
'cities#show'
get
'/cities'
,
to:
'cities#show'
get
'/categories'
,
to:
'categories#show'
get
'/categories'
,
to:
'categories#show'
get
'jobs/applied_jobs'
get
'jobs/applied_jobs'
get
'jobs/show/'
resource
:cities
resource
:cities
devise_scope
:user
do
devise_scope
:user
do
...
...
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