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
Nguyen Ngoc Nghia
VeNJOB
Commits
29e2a9ed
Commit
29e2a9ed
authored
Feb 21, 2020
by
nnnghia98
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
admin page
parent
2f65fef8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
1 deletions
+18
-1
app/controllers/admins_controller.rb
+14
-0
app/controllers/users/my_pages_controller.rb
+1
-1
app/views/admins/index.html.erb
+1
-0
config/routes.rb
+2
-0
No files found.
app/controllers/admins_controller.rb
0 → 100644
View file @
29e2a9ed
class
AdminsController
<
ApplicationController
def
index
redirect_to
new_user_session_path
unless
user_signed_in?
redirect_to
root_path
unless
current_user
.
role?
@all_user
=
User
.
all
end
private
def
user_params
params
.
require
(
:user
).
permit
(
:id
,
:email
,
:role
)
end
end
app/controllers/users/my_pages_controller.rb
View file @
29e2a9ed
class
Users
::
MyPagesController
<
ApplicationController
before_action
:authenticate_user!
,
only:
[
:show
]
before_action
:authenticate_user!
,
only:
[
:show
,
:admin_control
]
def
show
end
...
...
app/views/admins/index.html.erb
0 → 100644
View file @
29e2a9ed
<%=
select
(
"user"
,
"email"
,
@all_user
.
collect
{
|
u
|
u
.
email
},
{
include_blank:
true
})
%>
config/routes.rb
View file @
29e2a9ed
...
...
@@ -11,6 +11,8 @@ Rails.application.routes.draw do
get
"apply"
,
to:
"jobs#apply"
get
"confirm"
,
to:
"jobs#confirm_apply"
post
"done"
,
to:
'jobs#finish_apply'
get
"admin"
,
to:
"admins#index"
,
as: :admin
resources
:admin
,
only:
[
:index
,
:show
]
devise_for
:users
root
"tops#index"
namespace
:users
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