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
bc15b910
Commit
bc15b910
authored
Jul 13, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show search result
parent
5c9cf52e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
10 deletions
+2
-10
app/controllers/jobs_controller.rb
+1
-0
app/models/job.rb
+0
-9
app/views/layouts/_search.html.erb
+1
-1
No files found.
app/controllers/jobs_controller.rb
View file @
bc15b910
...
...
@@ -72,6 +72,7 @@ class JobsController < ApplicationController
@job_count
=
Job
.
where
(
id:
params
[
:job_ids
]).
count
@jobs
=
Job
.
where
(
id:
params
[
:job_ids
]).
page
params
[
:page
]
@search_conditions
=
"All jobs in
#{
params
[
:search_conditions
]
}
"
@search_text
=
params
[
:search_conditions
]
end
end
...
...
app/models/job.rb
View file @
bc15b910
class
Job
<
ApplicationRecord
after_save
:import_solr
belongs_to
:city
,
optional:
true
belongs_to
:company
,
optional:
true
belongs_to
:job_type
,
optional:
true
...
...
@@ -10,12 +9,4 @@ class Job < ApplicationRecord
paginates_per
20
validates
:name
,
presence:
true
,
length:
{
maximum:
200
}
private
def
import_solr
rsolr
=
RSolr
.
connect
url:
'http://localhost:8983/solr/veNJOBDATA/'
rsolr
.
add
(
job_id:
id
,
job_name:
name
,
job_description:
description
)
rsolr
.
commit
end
end
app/views/layouts/_search.html.erb
View file @
bc15b910
<%=
form_tag
jobs_search_path
do
%>
<div
class=
"row form-group"
>
<div
class=
"col-md-10"
>
<%=
text_area_tag
'text_search'
,
''
,
class:
'form-control'
%>
<%=
text_area_tag
'text_search'
,
@search_text
,
class:
'form-control'
%>
</div>
<div
class=
"col-md-2"
>
<%=
submit_tag
'Search'
,
class:
'btn btn-primary'
%>
...
...
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