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
3b8352e6
Commit
3b8352e6
authored
Dec 10, 2019
by
nnnghia98
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit routes/controllers
parent
b29eef09
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
20 deletions
+8
-20
app/controllers/application_controller.rb
+1
-1
app/controllers/users/my_pages_controller.rb
+2
-2
app/controllers/users/registrations_controller.rb
+0
-14
app/views/layouts/_header.html.erb
+1
-1
app/views/users/my_pages/show.html.erb
+1
-1
config/routes.rb
+3
-1
No files found.
app/controllers/application_controller.rb
View file @
3b8352e6
...
@@ -6,7 +6,7 @@ class ApplicationController < ActionController::Base
...
@@ -6,7 +6,7 @@ class ApplicationController < ActionController::Base
protected
protected
def
configure_permitted_parameters
def
configure_permitted_parameters
added_attrs
=
[
:first_name
,
:last_name
,
:username
,
:email
,
:password
,
:password_confirmation
,
:remember_me
]
added_attrs
=
[
:first_name
,
:last_name
,
:username
]
devise_parameter_sanitizer
.
permit
:sign_up
,
keys:
added_attrs
devise_parameter_sanitizer
.
permit
:sign_up
,
keys:
added_attrs
devise_parameter_sanitizer
.
permit
:account_update
,
keys:
added_attrs
devise_parameter_sanitizer
.
permit
:account_update
,
keys:
added_attrs
end
end
...
...
app/controllers/users/my_page_controller.rb
→
app/controllers/users/my_page
s
_controller.rb
View file @
3b8352e6
class
Users
::
MyPageController
<
ApplicationController
class
Users
::
MyPage
s
Controller
<
ApplicationController
def
index
def
show
end
end
end
end
app/controllers/users/registrations_controller.rb
deleted
100644 → 0
View file @
b29eef09
class
Users
::
RegistrationsController
<
Devise
::
RegistrationsController
before_action
:sign_up_params
,
only: :create
before_action
:account_update_params
,
only: :update
private
def
sign_up_params
params
.
require
(
:user
).
permit
(
:first_name
,
:last_name
,
:email
,
:password
,
:password_confirmation
)
end
def
account_update_params
params
.
require
(
:user
).
permit
(
:first_name
,
:last_name
,
:email
,
:password
,
:password_confirmation
,
:current_password
)
end
end
app/views/layouts/_header.html.erb
View file @
3b8352e6
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<ul
class=
"list"
>
<ul
class=
"list"
>
<%
if
user_signed_in?
%>
<%
if
user_signed_in?
%>
Logged in as
<strong>
<%=
current_user
.
email
%>
</strong>
Logged in as
<strong>
<%=
current_user
.
email
%>
</strong>
<li
class=
"list-inline-item"
></li>
<%=
link_to
"My Page"
,
my
_path
%>
</li>
<li
class=
"list-inline-item"
></li>
<%=
link_to
"My Page"
,
users_my_page
_path
%>
</li>
<li
class=
"list-inline-item"
></li>
<%=
link_to
"Logout"
,
destroy_user_session_path
,
method: :delete
%>
</li>
<li
class=
"list-inline-item"
></li>
<%=
link_to
"Logout"
,
destroy_user_session_path
,
method: :delete
%>
</li>
<%
else
%>
<%
else
%>
<li
class=
"list-inline-item"
>
<%=
link_to
"Login"
,
new_user_session_path
%>
</li>
<li
class=
"list-inline-item"
>
<%=
link_to
"Login"
,
new_user_session_path
%>
</li>
...
...
app/views/users/my_page
/index
.html.erb
→
app/views/users/my_page
s/show
.html.erb
View file @
3b8352e6
...
@@ -5,6 +5,6 @@
...
@@ -5,6 +5,6 @@
<h3>
Full name:
<%=
current_user
.
first_name
%>
<%=
current_user
.
last_name
%>
</h3>
<h3>
Full name:
<%=
current_user
.
first_name
%>
<%=
current_user
.
last_name
%>
</h3>
<h3>
My CV:
<%=
current_user
.
cv_path
%>
</h3>
<h3>
My CV:
<%=
current_user
.
cv_path
%>
</h3>
<br>
<br>
<%=
link_to
"
Update
"
,
edit_user_registration_path
,
class:
"btn btn-lg btn-primary"
%>
<%=
link_to
"
Edit
"
,
edit_user_registration_path
,
class:
"btn btn-lg btn-primary"
%>
<%=
link_to
"My jobs"
,
"#"
,
class:
"btn btn-lg btn-primary"
%>
<%=
link_to
"My jobs"
,
"#"
,
class:
"btn btn-lg btn-primary"
%>
</div>
</div>
config/routes.rb
View file @
3b8352e6
...
@@ -6,5 +6,7 @@ Rails.application.routes.draw do
...
@@ -6,5 +6,7 @@ Rails.application.routes.draw do
devise_for
:users
devise_for
:users
root
"static_pages#index"
root
"static_pages#index"
get
"static_pages/index"
get
"static_pages/index"
get
"my"
,
to:
"users/my_page#index"
namespace
:users
do
resource
:my_page
,
only: :show
end
end
end
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