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
e259e87c
Commit
e259e87c
authored
Jul 06, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send mail register complete
parent
ff98bf1f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
33 deletions
+50
-33
app/controllers/application_controller.rb
+0
-6
app/controllers/confirmations_controller.rb
+8
-0
app/controllers/registrations_controller.rb
+12
-0
app/views/devise/registrations/new.html.erb
+27
-21
config/locales/devise.en.yml
+1
-1
config/routes.rb
+2
-5
No files found.
app/controllers/application_controller.rb
View file @
e259e87c
class
ApplicationController
<
ActionController
::
Base
protect_from_forgery
with: :exception
before_action
:configure_permitted_parameters
,
if: :devise_controller?
def
configure_permitted_parameters
# devise_parameter_sanitizer.fork(:sign_up) << :email
# devise_parameter_sanitizer.fork(:account_update) << :email
end
end
app/controllers/confirmations_controller.rb
0 → 100644
View file @
e259e87c
class
ConfirmationsController
<
Devise
::
ConfirmationsController
protected
def
after_confirmation_path_for
(
resource_name
,
resource
)
edit_user_registration_path
(
resource
)
end
end
app/controllers/registrations_controller.rb
0 → 100644
View file @
e259e87c
class
RegistrationsController
<
Devise
::
RegistrationsController
protected
def
after_sign_up_path_for
(
resource
)
new_user_registration_path
end
def
after_inactive_sign_up_path_for
(
resource
)
new_user_registration_path
end
end
app/views/devise/registrations/new.html.erb
View file @
e259e87c
<%-
provide
(
:title
,
'Register'
)
-%>
<div
class=
"well"
>
<h2>
Register
</h2>
<%-
if
user_signed_in?
-%>
<p>
Hi guys!
</p>
<%-
else
-%>
<%=
form_for
(
resource
,
as:
resource_name
,
url:
registration_path
(
resource_name
))
do
|
f
|
%>
<%=
devise_error_messages!
%>
<%=
form_for
(
resource
,
as:
resource_name
,
url:
registration_path
(
resource_name
))
do
|
f
|
%>
<%=
devise_error_messages!
%>
<div
class=
"form-group"
>
<%=
f
.
label
:email
%>
<br
/>
<%=
f
.
email_field
:email
,
autofocus:
true
,
class:
'form-control'
%>
</div>
<div
class=
"form-group"
>
<%=
f
.
label
:email
%>
<br
/>
<%=
f
.
email_field
:email
,
autofocus:
true
,
class:
'form-control'
%>
</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
%>
<%=
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=
"form-group"
>
<%=
f
.
label
:password_confirmation
%>
<br
/>
<%=
f
.
password_field
:password_confirmation
,
autocomplete:
"off"
,
class:
'form-control'
%>
</div>
<div
class=
"actions"
>
<%=
f
.
submit
"Confirm your email"
,
class:
'btn btn-primary'
%>
</div>
<%
end
%>
<%-
end
-%>
<div
class=
"actions"
>
<%=
f
.
submit
"Confirm your email"
,
class:
'btn btn-primary'
%>
</div>
<%
end
%>
</div>
config/locales/devise.en.yml
View file @
e259e87c
...
...
@@ -41,7 +41,7 @@ en:
signed_up
:
"
Welcome!
You
have
signed
up
successfully."
signed_up_but_inactive
:
"
You
have
signed
up
successfully.
However,
we
could
not
sign
you
in
because
your
account
is
not
yet
activated."
signed_up_but_locked
:
"
You
have
signed
up
successfully.
However,
we
could
not
sign
you
in
because
your
account
is
locked."
signed_up_but_unconfirmed
:
"
A
message
with
a
confirmation
link
has
been
sent
to
your
email
address.
Please
follow
the
link
to
activate
your
account
."
signed_up_but_unconfirmed
:
"
Thank
you
for
register
our
service,
an
confirmation
email
with
registration
linkhas
been
sent
to
your
email.
Please
check
your
email
within
24
hours.
Please
note
that
the
registration
link
is
only
valid
for
24
hours.
Over
that
period,
you
will
have
to
register
your
email
again
."
update_needs_confirmation
:
"
You
updated
your
account
successfully,
but
we
need
to
verify
your
new
email
address.
Please
check
your
email
and
follow
the
confirm
link
to
confirm
your
new
email
address."
updated
:
"
Your
account
has
been
updated
successfully."
sessions
:
...
...
config/routes.rb
View file @
e259e87c
Rails
.
application
.
routes
.
draw
do
devise_for
:users
root
'static_pages#home'
get
'static_pages/home'
get
'/register'
,
to:
'users#new'
get
'/cities'
,
to:
'cities#show'
get
'/categories'
,
to:
'categories#show'
resource
:users
resource
:cities
devise_for
:users
,
controllers:
{
registrations:
'registrations'
,
confirmations:
'confirmations'
}
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
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