User login
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
app/views/users/my_page.html.erb 0 → 100644
1 <div class="container"> 2 <%= render 'layouts/flash' %> 3 <h1 class="text-center my-page-label">My Page</h1> 4 <div class="form-login"> 5 <div class="row form d-flex justify-content-center"> 6 <%= form_for(@user) do |f| %> -
app/controllers/users_controller.rb 0 → 100644
1 class UsersController < ApplicationController 2 before_action :signed_in_user, only: [:update, :my_page, :my_info] 3 def my_page 4 @user = User.find(current_user.id) -
app/controllers/users_controller.rb 0 → 100644
1 class UsersController < ApplicationController 2 before_action :signed_in_user, only: [:update, :my_page, :my_info] 3 def my_page 4 @user = User.find(current_user.id) 5 end 6 7 def my_info 8 @user = User.find(current_user.id) -
-
Toggle commit list
-
Toggle commit list
-
-
-
added 28 commits
-
02f91bdf...069f8180 - 27 commits from branch
master - 98f21089 - Merge branch 'master' into 'user_login'
Toggle commit list -
02f91bdf...069f8180 - 27 commits from branch
-
app/helpers/sessions_helper.rb 0 → 100644
11 current_user.present? 12 end 13 14 def current_user=(user) 15 @current_user = user 16 end 17 18 def current_user 19 remember_token = User.digest(cookies[:remember_token]) 20 @current_user ||= User.find_by(remember_token: remember_token) 21 end 22 23 def sign_out 24 # current_user.update_attribute(:remember_token, User.digest(User.new_remember_token)) 25 cookies.delete(:remember_token) 26 self.current_user = nil -
app/helpers/sessions_helper.rb 0 → 100644
3 def sign_in(user) 4 remember_token = User.new_remember_token 5 cookies.permanent[:remember_token] = remember_token 6 user.update_attribute(:remember_token, User.digest(remember_token)) 7 self.current_user = user 8 end 9 10 def signed_in? 11 current_user.present? 12 end 13 14 def current_user=(user) 15 @current_user = user 16 end 17 18 def current_user -
added 2 commits
Toggle commit list -
5 2 6 has_many :favorite_jobs 3 7 has_many :jobs, through: :favorite_jobs 4 8 has_many :job_applieds 5 9 has_many :jobs, through: :job_applieds 6 10 has_many :histories 7 11 has_many :jobs, through: :histories 12 13 has_secure_password 14 15 validates :name, presence: true, length: { maximum: 50 } 16 VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(?:\.[a-z\d\-]+)*\.[a-z]+\z/i 17 validates :email, presence: true, format: { with: VALID_EMAIL_REGEX }, 18 uniqueness: { case_sensitive: false } 19 20 validates :password, allow_nil: true, length: { minimum: 6, too_short: "is blank or too short" } -
added 28 commits
-
ed622ffa...069f8180 - 27 commits from branch
master - d0a30db4 - Merge branch 'master' into 'user_login'
Toggle commit list -
ed622ffa...069f8180 - 27 commits from branch
-
7 11 has_many :jobs, through: :histories 12 13 has_secure_password 14 15 validates :name, presence: true, length: { maximum: 50 } 16 VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(?:\.[a-z\d\-]+)*\.[a-z]+\z/i 17 validates :email, presence: true, format: { with: VALID_EMAIL_REGEX }, 18 uniqueness: { case_sensitive: false } 19 20 validates :password, allow_nil: true, length: { minimum: 6, too_short: "is blank or too short" } 21 22 def self.new_remember_token 23 SecureRandom.urlsafe_base64 24 end 25 26 def User.digest(token) -
7 11 has_many :jobs, through: :histories 12 13 has_secure_password 14 15 validates :name, presence: true, length: { maximum: 50 } 16 VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(?:\.[a-z\d\-]+)*\.[a-z]+\z/i 17 validates :email, presence: true, format: { with: VALID_EMAIL_REGEX }, 18 uniqueness: { case_sensitive: false } 19 20 validates :password, allow_nil: true, length: { minimum: 6, too_short: "is blank or too short" } 21 22 def self.new_remember_token 23 SecureRandom.urlsafe_base64 24 end 25 26 def User.digest(token) -
Master
dạ a e fix mấy comment xong e gửi lại nãy h e fix regex của password
-
-
-
1 1 Rails.application.routes.draw do 2 2 # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html 3 4 resources :users 5 resources :sessions, only: [:new, :create, :destroy] 6 match '/my', to: 'users#my_page', via: 'get', as: :my_page -
Master
dạ được a ơi, v. e sửa lại mấy cái a
-
-
added 28 commits
-
0ce58138...069f8180 - 27 commits from branch
master - ff926afe - Merge branch 'master' into 'user_login'
Toggle commit list -
0ce58138...069f8180 - 27 commits from branch
-
added 28 commits
-
0ce58138...069f8180 - 27 commits from branch
master - d6a7da13 - Merge branch 'master' into 'user_login'
Toggle commit list -
0ce58138...069f8180 - 27 commits from branch
-
-
Toggle commit list
-
added 28 commits
-
4a1c68f8...069f8180 - 27 commits from branch
master - 20b078ef - Merge branch 'master' into 'user_login'
Toggle commit list -
4a1c68f8...069f8180 - 27 commits from branch
-
-
added 28 commits
-
f940275d...069f8180 - 27 commits from branch
master - c17a3ae9 - Merge branch 'master' into 'user_login'
Toggle commit list -
f940275d...069f8180 - 27 commits from branch
-
merged
Toggle commit list