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
0
Merge Requests
0
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
Huỳnh Thiên Phước
venjob
Commits
9812c15c
Commit
9812c15c
authored
Aug 28, 2020
by
Huỳnh Thiên Phước
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
creating favorite
parent
55bb5b9b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
app/controllers/job_favorites_controller.rb
+0
-2
app/views/layouts/_show_job.html.erb
+2
-2
config/routes.rb
+1
-1
No files found.
app/controllers/job_favorites_controller.rb
View file @
9812c15c
class
JobFavoritesController
<
ApplicationController
class
JobFavoritesController
<
ApplicationController
before_action
:sign_in_validation
,
only:
[
:create
,
:destroy
]
before_action
:sign_in_validation
,
only:
[
:create
,
:destroy
]
before_action
:find_job_id
,
only:
[
:new
]
def
create
def
create
end
end
def
destroy
def
destroy
...
...
app/views/layouts/_show_job.html.erb
View file @
9812c15c
...
@@ -17,8 +17,8 @@
...
@@ -17,8 +17,8 @@
<%=
link_to
'Read more..'
,
job_detail_path
(
job
.
id
)
%>
<%=
link_to
'Read more..'
,
job_detail_path
(
job
.
id
)
%>
</div>
</div>
</div>
</div>
<%=
link_to
follow_job_path
(
job
.
id
)
do
%>
<%=
form_for
(
:job_favorite
,
url:
follow_job_path
(
job
.
id
),
remote:
true
)
do
|
f
|
%>
<button
type=
"button"
class=
"btn btn-primary"
id=
"button-follow"
>
♥ Follow
</button
>
<%=
f
.
submit
"♥ Follow"
,
class:
"btn btn-primary"
,
id:
"button-follow"
%
>
<%
end
%>
<%
end
%>
</div>
</div>
</div>
</div>
...
...
config/routes.rb
View file @
9812c15c
...
@@ -33,7 +33,7 @@ Rails.application.routes.draw do
...
@@ -33,7 +33,7 @@ Rails.application.routes.draw do
get
'jobs/industry/:converted_name'
,
to:
'jobs#industry_jobs'
,
as: :industry_jobs
get
'jobs/industry/:converted_name'
,
to:
'jobs#industry_jobs'
,
as: :industry_jobs
get
'jobs/company/:converted_name'
,
to:
'jobs#company_jobs'
,
as: :company_jobs
get
'jobs/company/:converted_name'
,
to:
'jobs#company_jobs'
,
as: :company_jobs
post
'follow_job'
,
to:
'job_favorites#create'
,
as: :follow_job
post
'follow_job
/:id
'
,
to:
'job_favorites#create'
,
as: :follow_job
resources
:job_favorites
,
only:
[
:create
,
:destroy
]
resources
:job_favorites
,
only:
[
:create
,
:destroy
]
resources
:job_applieds
,
only:
[
:new
,
:create
]
resources
:job_applieds
,
only:
[
:new
,
:create
]
...
...
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