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
1593bd44
Commit
1593bd44
authored
Mar 12, 2020
by
thanhnd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix review 20200312 2
parent
2aed6bef
Pipeline
#508
failed with stages
in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
12 deletions
+4
-12
app/controllers/jobs_controller.rb
+3
-11
app/views/jobs/index.html.erb
+1
-1
No files found.
app/controllers/jobs_controller.rb
View file @
1593bd44
...
@@ -5,22 +5,14 @@ class JobsController < ApplicationController
...
@@ -5,22 +5,14 @@ class JobsController < ApplicationController
def
index
def
index
@job_count
=
Job
.
count
@job_count
=
Job
.
count
pagin
=
params
[
:page
].
to_i
>
0
?
params
[:
page
].
to_i
:
1
if
params
[
:page
].
to_i
>
0
pagin
=
params
[
:page
].
to_i
else
pagin
=
1
end
@pagin_job
=
Job
.
page
(
pagin
).
per
(
Settings
.
page
)
@pagin_job
=
Job
.
page
(
pagin
).
per
(
Settings
.
page
)
end
end
def
search
def
search
if
params
[
:search
].
nil?
return
redirect_to
root_path
,
alert:
"Empty field!"
if
params
[
:search
].
nil?
return
redirect_to
root_path
,
alert:
"Empty field!"
else
@search_job
=
Job
.
where
(
"job_name LIKE ?"
,
"%
#{
params
[
:search
]
}
%"
)
@search_job
=
Job
.
where
(
"job_name LIKE ?"
,
"%
#{
params
[
:search
]
}
%"
)
@pagin_job
=
@search_job
.
page
(
params
[
:page
]).
per
(
Settings
.
page
)
@pagin_job
=
@search_job
.
page
(
params
[
:page
]).
per
(
Settings
.
page
)
end
end
render
:index
end
end
end
app/views/jobs/index.html.erb
View file @
1593bd44
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<label>
Total Jobs:
<%=
Job
.
count
%>
</label>
<label>
Total Jobs:
<%=
Job
.
count
%>
</label>
</div>
</div>
<%=
render
partial:
"jobs"
%>
<%=
render
partial:
"jobs"
%>
</div>
</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