Commit 5e0dc4c1 by Thanh Hung Pham

Create information form

parent e259e87c
...@@ -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_registration_path(resource) registrations_information_path(resource)
end end
end end
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)
......
...@@ -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 }
......
<%- 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>
...@@ -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>
......
...@@ -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
......
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