Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob_thanhnd
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
3
Merge Requests
3
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
thanhnd
venjob_thanhnd
Commits
8b4e9b3b
Commit
8b4e9b3b
authored
Mar 03, 2020
by
thanhnd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
job_list_page 20200303 2
parent
8797dd8e
Pipeline
#491
failed with stages
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
4 deletions
+32
-4
app/controllers/jobs_controller.rb
+3
-3
app/views/jobs/index.html.erb
+2
-1
app/views/jobs/search.html.erb
+27
-0
No files found.
app/controllers/jobs_controller.rb
View file @
8b4e9b3b
...
...
@@ -10,11 +10,11 @@ class JobsController < ApplicationController
end
def
search
if
params
[
:search
].
blank
?
if
params
[
:search
].
nil
?
redirect_to
(
root_path
,
alert:
"Empty field!"
)
and
return
else
@
parameter
=
params
[
:search
].
downcase
@search_job
=
Job
.
where
(
"job_name LIKE '%
#{
params
[
:search
]
}
'"
)
@
job_count
=
Job
.
count
@search_job
=
Job
.
where
(
"job_name LIKE '%
#{
params
[
:search
]
}
%
'"
)
@pagin_job
=
@search_job
.
page
(
params
[
:page
]).
per
(
20
)
end
render
:index
...
...
app/views/jobs/index.html.erb
View file @
8b4e9b3b
...
...
@@ -9,6 +9,7 @@
</div>
<div
id=
"job_list"
class=
"container p-5 my-2 bg-secondary text-white"
>
<div
class=
"total_job"
>
...
...
@@ -26,8 +27,8 @@
<li
><span
class=
"text"
>
<%=
job
.
description
%>
</span></li>
</ul>
<%
end
%>
<%=
paginate
@pagin_job
%>
<%=
paginate
@pagin_job
%>
</div>
...
...
app/views/jobs/search.html.erb
0 → 100644
View file @
8b4e9b3b
<div
id=
"search"
class=
"container p-5 my-2 bg-secondary text-white"
>
<%=
form_tag
job_search_path
,
method: :get
do
%>
<p>
<%=
text_field_tag
:search
,
params
[
:search
]
%>
<%=
button_tag
"Search"
,
name:
nil
%>
</p>
<%
end
%>
</div>
<div
id=
"job_list"
class=
"container p-5 my-2 bg-secondary text-white"
>
<font
color=
"red"
><b><label
>
Job List:
</label></b></font>
<%=
paginate
@pagin_job
%>
<%
@pagin_job
.
each
do
|
job
|
%>
<ul>
<button
class=
"button button2"
>
Favorites
</button>
<li>
<%=
job
.
job_name
%>
</li>
<li>
<%=
job
.
city
.
city_name
%>
</li>
<li
><span
class=
"text"
>
<%=
job
.
description
%>
</span></li>
</ul>
<%
end
%>
<%=
paginate
@pagin_job
%>
</div>
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