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
5e0dc4c1
Commit
5e0dc4c1
authored
Jul 06, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create information form
parent
e259e87c
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
15 deletions
+46
-15
app/controllers/confirmations_controller.rb
+1
-1
app/controllers/registrations_controller.rb
+4
-0
app/models/user.rb
+1
-1
app/views/devise/registrations/information.html.erb
+37
-0
app/views/devise/registrations/new.html.erb
+0
-13
config/routes.rb
+3
-0
No files found.
app/controllers/confirmations_controller.rb
View file @
5e0dc4c1
...
@@ -3,6 +3,6 @@ class ConfirmationsController < Devise::ConfirmationsController
...
@@ -3,6 +3,6 @@ class ConfirmationsController < Devise::ConfirmationsController
protected
protected
def
after_confirmation_path_for
(
resource_name
,
resource
)
def
after_confirmation_path_for
(
resource_name
,
resource
)
edit_user_registr
ation_path
(
resource
)
registrations_inform
ation_path
(
resource
)
end
end
end
end
app/controllers/registrations_controller.rb
View file @
5e0dc4c1
class
RegistrationsController
<
Devise
::
RegistrationsController
class
RegistrationsController
<
Devise
::
RegistrationsController
def
information
render
'devise/registrations/information'
end
protected
protected
def
after_sign_up_path_for
(
resource
)
def
after_sign_up_path_for
(
resource
)
...
...
app/models/user.rb
View file @
5e0dc4c1
...
@@ -2,7 +2,7 @@ class User < ApplicationRecord
...
@@ -2,7 +2,7 @@ class User < ApplicationRecord
# Include default devise modules. Others available are:
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
# :confirmable, :lockable, :timeoutable and :omniauthable
devise
:database_authenticatable
,
:registerable
,
devise
:database_authenticatable
,
:registerable
,
:recoverable
,
:rememberable
,
:trackable
,
:validatable
,
:recoverable
,
:rememberable
,
:trackable
,
:confirmable
,
:lockable
:confirmable
,
:lockable
VALID_EMAIL_REGEX
=
/\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
VALID_EMAIL_REGEX
=
/\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates
:email
,
length:
{
maximum:
255
},
format:
{
with:
VALID_EMAIL_REGEX
}
validates
:email
,
length:
{
maximum:
255
},
format:
{
with:
VALID_EMAIL_REGEX
}
...
...
app/views/devise/registrations/information.html.erb
0 → 100644
View file @
5e0dc4c1
<%-
provide
(
:title
,
'Complete information'
)
-%>
<div
class=
"well"
>
<h2>
Register
</h2>
<%=
form_for
(
resource
,
as:
resource_name
,
url:
registration_path
(
resource_name
),
html:
{
method: :put
})
do
|
f
|
%>
<%=
devise_error_messages!
%>
<div
class=
"form-group"
>
<%=
f
.
label
:email
%>
<%=
f
.
email_field
:email
,
autofocus:
true
,
class:
'form-control'
%>
</div>
<div
class=
"form-group"
>
<%=
f
.
label
:fullname
%>
<%=
f
.
text_field
:fullname
,
class:
'form-control'
%>
</div>
<div
class=
"form-group"
>
<%=
f
.
label
:password
%>
<br
/>
<%=
f
.
password_field
:password
,
autocomplete:
"off"
,
class:
'form-control'
%>
</div>
<div
class=
"form-group"
>
<%=
f
.
label
:password_confirmation
%>
<%=
f
.
password_field
:password_confirmation
,
autocomplete:
"off"
,
class:
'form-control'
%>
</div>
<div
class=
"form-group"
>
<%=
f
.
label
:cv_name
%>
<%=
f
.
file_field
:cv_name
,
class:
'form-control'
%>
</div>
<div
class=
"actions"
>
<%=
f
.
submit
"Register"
,
class:
'btn btn-primary'
%>
</div>
<%-
end
-%>
</div>
app/views/devise/registrations/new.html.erb
View file @
5e0dc4c1
...
@@ -14,19 +14,6 @@
...
@@ -14,19 +14,6 @@
<%=
f
.
email_field
:email
,
autofocus:
true
,
class:
'form-control'
%>
<%=
f
.
email_field
:email
,
autofocus:
true
,
class:
'form-control'
%>
</div>
</div>
<div
class=
"form-group"
>
<%=
f
.
label
:password
%>
<%=
f
.
password_field
:password
,
autocomplete:
'off'
,
class:
'form-control'
%>
<%-
if
@validatable
-%>
<span
class=
"help-block"
>
<%=
minimum_password_length
%>
characters minimum
</span>
<%-
end
-%>
</div>
<div
class=
"form-group"
>
<%=
f
.
label
:password_confirmation
%>
<br
/>
<%=
f
.
password_field
:password_confirmation
,
autocomplete:
"off"
,
class:
'form-control'
%>
</div>
<div
class=
"actions"
>
<div
class=
"actions"
>
<%=
f
.
submit
"Confirm your email"
,
class:
'btn btn-primary'
%>
<%=
f
.
submit
"Confirm your email"
,
class:
'btn btn-primary'
%>
</div>
</div>
...
...
config/routes.rb
View file @
5e0dc4c1
...
@@ -6,6 +6,9 @@ Rails.application.routes.draw do
...
@@ -6,6 +6,9 @@ Rails.application.routes.draw do
get
'/categories'
,
to:
'categories#show'
get
'/categories'
,
to:
'categories#show'
resource
:cities
resource
:cities
devise_scope
:user
do
get
'/registrations/information'
,
to:
'registrations#information'
end
devise_for
:users
,
controllers:
{
registrations:
'registrations'
,
devise_for
:users
,
controllers:
{
registrations:
'registrations'
,
confirmations:
'confirmations'
}
confirmations:
'confirmations'
}
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
...
...
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