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
e089ae33
Commit
e089ae33
authored
Jul 11, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get condition search
parent
904865d8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
app/controllers/jobs_controller.rb
+6
-0
app/views/layouts/_search.html.erb
+6
-4
config/routes.rb
+1
-0
No files found.
app/controllers/jobs_controller.rb
View file @
e089ae33
...
@@ -3,6 +3,12 @@ class JobsController < ApplicationController
...
@@ -3,6 +3,12 @@ class JobsController < ApplicationController
@applied_jobs
=
Apply
.
where
(
user_id:
current_user
.
id
)
@applied_jobs
=
Apply
.
where
(
user_id:
current_user
.
id
)
end
end
def
search
@search_conditions
=
params
[
:text_search
]
redirect_to
jobs_show_path
end
def
detail
def
detail
@job
=
Job
.
find
(
params
[
:id
])
@job
=
Job
.
find
(
params
[
:id
])
History
.
new
(
user:
current_user
,
job:
@job
).
save
if
History
.
where
(
user:
current_user
,
job:
@job
).
blank?
History
.
new
(
user:
current_user
,
job:
@job
).
save
if
History
.
where
(
user:
current_user
,
job:
@job
).
blank?
...
...
app/views/layouts/_search.html.erb
View file @
e089ae33
<div
class=
"row form-group"
>
<%=
form_tag
jobs_search_path
do
%>
<div
class=
"row form-group"
>
<div
class=
"col-md-10"
>
<div
class=
"col-md-10"
>
<textarea
class=
"form-control"
></textarea
>
<%=
text_area_tag
'text_search'
,
''
,
class:
'form-control'
%
>
</div>
</div>
<div
class=
"col-md-2"
>
<div
class=
"col-md-2"
>
<%=
link_to
'Search'
,
'#
'
,
class:
'btn btn-primary'
%>
<%=
submit_tag
'Search
'
,
class:
'btn btn-primary'
%>
</div>
</div>
</div>
</div>
<%-
end
-%>
config/routes.rb
View file @
e089ae33
...
@@ -17,6 +17,7 @@ Rails.application.routes.draw do
...
@@ -17,6 +17,7 @@ Rails.application.routes.draw do
get
'jobs/favorite_remove'
,
to:
'jobs#favorite_remove'
get
'jobs/favorite_remove'
,
to:
'jobs#favorite_remove'
get
'jobs/favorited_jobs'
,
to:
'jobs#favorited_jobs'
get
'jobs/favorited_jobs'
,
to:
'jobs#favorited_jobs'
get
'jobs/history_jobs'
,
to:
'jobs#history_jobs'
get
'jobs/history_jobs'
,
to:
'jobs#history_jobs'
post
'jobs/search'
,
to:
'jobs#search'
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