Commit e259e87c by Thanh Hung Pham

Send mail register complete

parent ff98bf1f
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
protect_from_forgery with: :exception 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 end
class ConfirmationsController < Devise::ConfirmationsController
protected
def after_confirmation_path_for(resource_name, resource)
edit_user_registration_path(resource)
end
end
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
<%- provide(:title, 'Register') -%> <%- provide(:title, 'Register') -%>
<div class="well"> <div class="well">
<h2>Register</h2> <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| %> <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %> <%= devise_error_messages! %>
...@@ -27,4 +31,6 @@ ...@@ -27,4 +31,6 @@
<%= f.submit "Confirm your email", class: 'btn btn-primary' %> <%= f.submit "Confirm your email", class: 'btn btn-primary' %>
</div> </div>
<% end %> <% end %>
<%- end -%>
</div> </div>
...@@ -41,7 +41,7 @@ en: ...@@ -41,7 +41,7 @@ en:
signed_up: "Welcome! You have signed up successfully." 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_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_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." 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." updated: "Your account has been updated successfully."
sessions: sessions:
......
Rails.application.routes.draw do Rails.application.routes.draw do
devise_for :users
root 'static_pages#home' root 'static_pages#home'
get 'static_pages/home' get 'static_pages/home'
get '/register', to: 'users#new'
get '/cities', to: 'cities#show' get '/cities', to: 'cities#show'
get '/categories', to: 'categories#show' get '/categories', to: 'categories#show'
resource :users
resource :cities 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 # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment