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
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xuan Trung Le
venjob
Commits
4f6a51d3
Commit
4f6a51d3
authored
Nov 15, 2017
by
Xuan Trung Le
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs: admin can apply or favorite job
parent
0520750e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletions
+10
-1
app/controllers/application_controller.rb
+8
-1
app/controllers/applies_controller.rb
+1
-0
app/controllers/favorites_controller.rb
+1
-0
No files found.
app/controllers/application_controller.rb
View file @
4f6a51d3
class
ApplicationController
<
ActionController
::
Base
protect_from_forgery
with: :exception
helper_method
:clear_session_candidate
helper_method
:clear_session_candidate
,
:admin_can_not_do_this
def
clear_session_candidate
session
[
:candidate
]
=
{}
...
...
@@ -14,4 +14,11 @@ class ApplicationController < ActionController::Base
super
end
end
def
admin_can_not_do_this
if
current_admin
flash
[
:notice
]
=
"Admin can't do this"
redirect_back
(
fallback_location:
root_path
)
end
end
end
app/controllers/applies_controller.rb
View file @
4f6a51d3
class
AppliesController
<
ApplicationController
before_action
:admin_can_not_do_this
before_action
:authenticate_user!
def
apply
session
[
:job_id
]
=
params
[
:job_id
]
if
params
[
:job_id
]
...
...
app/controllers/favorites_controller.rb
View file @
4f6a51d3
class
FavoritesController
<
ApplicationController
before_action
:admin_can_not_do_this
before_action
:authenticate_user!
def
index
@jobs
=
current_user
.
liked_jobs
.
includes
(
:company
)
...
...
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