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
b17d7178
Commit
b17d7178
authored
Jul 10, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove favorite jobs
parent
068e93ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
app/assets/javascripts/custom.js
+2
-2
app/controllers/jobs_controller.rb
+1
-1
config/routes.rb
+0
-2
No files found.
app/assets/javascripts/custom.js
View file @
b17d7178
...
...
@@ -2,7 +2,7 @@ $(function() {
$
(
".favorite_add"
).
on
(
"click"
,
function
()
{
$
.
ajax
({
url
:
"/jobs/favorite"
,
type
:
"
POS
T"
,
type
:
"
GE
T"
,
data
:
{
"job_id"
:
$
(
"#job_id"
).
val
()},
dataType
:
"json"
,
success
:
function
(
data
)
{
...
...
@@ -14,7 +14,7 @@ $(function() {
$
(
".favorite_remove"
).
on
(
"click"
,
function
()
{
$
.
ajax
({
url
:
"/jobs/favorite_remove"
,
type
:
"
POS
T"
,
type
:
"
GE
T"
,
data
:
{
"job_id"
:
$
(
"#job_id"
).
val
()},
dataType
:
"json"
,
success
:
function
(
data
)
{
...
...
app/controllers/jobs_controller.rb
View file @
b17d7178
...
...
@@ -26,7 +26,7 @@ class JobsController < ApplicationController
def
favorite_remove
job
=
Job
.
find
(
params
[
:job_id
])
Favorite
.
where
(
user:
current_user
,
job:
job
).
destroy
Favorite
.
where
(
user:
current_user
,
job:
job
).
destroy
_all
end
def
favorited_jobs
...
...
config/routes.rb
View file @
b17d7178
...
...
@@ -8,9 +8,7 @@ Rails.application.routes.draw do
get
'jobs/applied_jobs'
,
to:
'jobs#applied_jobs'
get
'jobs/show/'
,
to:
'jobs#show'
get
'jobs/favorite'
,
to:
'jobs#favorite'
post
'jobs/favorite'
,
to:
'jobs#favorite'
get
'jobs/favorite_remove'
,
to:
'jobs#favorite_remove'
post
'jobs/favorite_remove'
,
to:
'jobs#favorite_remove'
get
'jobs/favorited_jobs'
,
to:
'jobs#favorited_jobs'
get
'jobs/history_jobs'
,
to:
'jobs#history_jobs'
...
...
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