Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
S
sample_app
  • 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 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Đường Sỹ Hoàng
  • sample_app
  • Merge Requests
  • !7

Merged
Opened Nov 13, 2019 by Đường Sỹ Hoàng@hoangds 
  • Report abuse
Report abuse

Implement basic login

×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b basic-design origin/basic-design

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout master
git merge --no-ff basic-design

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 10
  • Commits 17
  • Changes 21
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Đường Sỹ Hoàng @hoangds

    added 1 commit

    • 47d3b1db - Removed identation line 16

    Compare with previous version

    Nov 13, 2019

    added 1 commit

    • 47d3b1db - Removed identation line 16

    Compare with previous version

    added 1 commit * 47d3b1db - Removed identation line 16 [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4308&start_sha=ed85a662951708e1236bd6a7761ca0cf6f97c05b)
    Toggle commit list
  • Van Hau Le
    @haulv started a discussion on an old version of the diff Nov 13, 2019
    Resolved by Đường Sỹ Hoàng Nov 13, 2019
    app/helpers/sessions_helper.rb 0 → 100644
    1 module SessionsHelper
    2 # Logs in the given user.
    3 def log_in(user)
    4 session[:user_id] = user.id
    5 end
    6 # Returns the current logged-in user (if any)
    7 def current_user
    8 if session[ :user_id]
    9 @current_user ||= User.find_by( id: session[ :user_id])
    10 end
    11 end
    12
    13 # Return true if the user is logged in, false otherwise .
    14 def logged_in?
    15 !current_user.nil?
    • Van Hau Le @haulv commented Nov 13, 2019
      Developer

      @hoangds please use current_user.present? Please avoid using nagetive operator (!)

      @hoangds please use current_user.present? Please avoid using nagetive operator (!)
    • Đường Sỹ Hoàng @hoangds

      changed this line in version 3 of the diff

      Nov 13, 2019

      changed this line in version 3 of the diff

      changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4309&start_sha=47d3b1dbf383990f9ff3406949fbed9174a20983#59459d8ae6eb34ed02b9dd3b6d40207e2ab982ca_15_15)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Nov 13, 2019
    Resolved by Đường Sỹ Hoàng Nov 13, 2019
    app/controllers/sessions_controller.rb 0 → 100644
    1 class SessionsController < ApplicationController
    2 def new
    3 end
    4
    5 def create
    6 user = User.find_by( email: params[ :session ][ :email ].downcase )
    • Son Do Hong @sondh commented Nov 13, 2019
      Master

      User.find_by(email: params[:session][:email].downcase) không sử dụng space ở dấu ( và [

      `User.find_by(email: params[:session][:email].downcase)` không sử dụng space ở dấu `(` và `[`
    • Đường Sỹ Hoàng @hoangds

      changed this line in version 3 of the diff

      Nov 13, 2019

      changed this line in version 3 of the diff

      changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4309&start_sha=47d3b1dbf383990f9ff3406949fbed9174a20983#a7c8e5306369685dc160701bbafa8a14286fd15b_6_6)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Nov 13, 2019
    Resolved by Đường Sỹ Hoàng Nov 13, 2019
    app/models/user.rb
    1 1 class User < ApplicationRecord
    2 def User.digest(string)
    3 cost = ActiveModel::SecurePassword.min_cost ? BCrypt::Engine::MIN_COST :
    4 BCrypt::Engine.cost
    • Son Do Hong @sondh commented Nov 13, 2019
      Master

      luôn giữ cho đoạn toán tử 3 ngôi nằm trên 1 dòng

      luôn giữ cho đoạn toán tử 3 ngôi nằm trên 1 dòng
    • Đường Sỹ Hoàng @hoangds

      changed this line in version 4 of the diff

      Nov 13, 2019

      changed this line in version 4 of the diff

      changed this line in [version 4 of the diff](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4310&start_sha=f5471581aa31f4d4bc1f3faa4f032e269e67fe74#4ed0c03b53dbc8320da88e7887465514cd9e90a4_4_2)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Nov 13, 2019
    Resolved by Đường Sỹ Hoàng Nov 13, 2019
    app/models/user.rb
    1 1 class User < ApplicationRecord
    2 def User.digest(string)
    3 cost = ActiveModel::SecurePassword.min_cost ? BCrypt::Engine::MIN_COST :
    4 BCrypt::Engine.cost
    5 BCrypt::Password.create(string, cost: cost)
    6 end
    7
    8 # Constant
    • Son Do Hong @sondh commented Nov 13, 2019
      Master

      k cần thiết viết comment ở đây

      k cần thiết viết comment ở đây
    • Đường Sỹ Hoàng @hoangds

      changed this line in version 4 of the diff

      Nov 13, 2019

      changed this line in version 4 of the diff

      changed this line in [version 4 of the diff](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4310&start_sha=f5471581aa31f4d4bc1f3faa4f032e269e67fe74#4ed0c03b53dbc8320da88e7887465514cd9e90a4_8_2)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Nov 13, 2019
    Resolved by Đường Sỹ Hoàng Nov 13, 2019
    app/models/user.rb
    1 1 class User < ApplicationRecord
    2 def User.digest(string)
    • Son Do Hong @sondh commented Nov 13, 2019
      Master

      định nghĩa hàm cho xuống dưới cùng, sau các marco

      định nghĩa hàm cho xuống dưới cùng, sau các marco
    • Đường Sỹ Hoàng @hoangds

      changed this line in version 4 of the diff

      Nov 13, 2019

      changed this line in version 4 of the diff

      changed this line in [version 4 of the diff](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4310&start_sha=f5471581aa31f4d4bc1f3faa4f032e269e67fe74#4ed0c03b53dbc8320da88e7887465514cd9e90a4_2_2)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Nov 13, 2019
    Resolved by Đường Sỹ Hoàng Nov 13, 2019
    app/views/layouts/_header.html.erb
    5 5 <ul class="nav navbar-nav navbar-right">
    6 6 <li><%= link_to "Home", root_path %></li>
    7 7 <li><%= link_to "Help", help_path %></li>
    8 <li><%= link_to "Log in", '#' %></li>
    8 <% if logged_in? %>
    9 <li><%= link_to "Users", '#' %></li>
    • Son Do Hong @sondh commented Nov 13, 2019
      Master

      double quote

      double quote
    • Đường Sỹ Hoàng @hoangds

      changed this line in version 4 of the diff

      Nov 13, 2019

      changed this line in version 4 of the diff

      changed this line in [version 4 of the diff](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4310&start_sha=f5471581aa31f4d4bc1f3faa4f032e269e67fe74#12e0ffa73350b6f8b572afab727eeab71ee1df63_9_9)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on the diff Nov 13, 2019
    Resolved by Đường Sỹ Hoàng Nov 13, 2019
    test/controllers/sessions_controller_test.rb 0 → 100644
    1 require "test_helper"
    2
    3 class SessionsControllerTest < ActionDispatch::IntegrationTest
    4
    • Son Do Hong @sondh commented Nov 13, 2019
      Master

      remove empty line

      Edited Nov 13, 2019
      remove empty line
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on the diff Nov 13, 2019
    Resolved by Đường Sỹ Hoàng Nov 13, 2019
    test/integration/user_signup_test.rb → test/integration/users_signup_test.rb
    19 19 end
    20 20 follow_redirect!
    21 21 assert_template "users/show"
    22 assert_not flash.empty?
    • Son Do Hong @sondh commented Nov 13, 2019
      Master

      giữ lại test case này

      giữ lại test case này
    Please register or sign in to reply
  • Đường Sỹ Hoàng @hoangds

    added 2 commits

    • 0d5714a0 - Removed space in line 6&7
    • f5471581 - Replaced negative operator in line 15

    Compare with previous version

    Nov 13, 2019

    added 2 commits

    • 0d5714a0 - Removed space in line 6&7
    • f5471581 - Replaced negative operator in line 15

    Compare with previous version

    added 2 commits * 0d5714a0 - Removed space in line 6&amp;7 * f5471581 - Replaced negative operator in line 15 [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4309&start_sha=47d3b1dbf383990f9ff3406949fbed9174a20983)
    Toggle commit list
  • Đường Sỹ Hoàng @hoangds

    added 4 commits

    • efa230fd - Removed empty line
    • 9c586237 - Replaced with double quote in line 9
    • 6545291f - Fixed order of method in line 12 & remove comments
    • 6bcee648 - Undo assert method in line 22

    Compare with previous version

    Nov 13, 2019

    added 4 commits

    • efa230fd - Removed empty line
    • 9c586237 - Replaced with double quote in line 9
    • 6545291f - Fixed order of method in line 12 & remove comments
    • 6bcee648 - Undo assert method in line 22

    Compare with previous version

    added 4 commits * efa230fd - Removed empty line * 9c586237 - Replaced with double quote in line 9 * 6545291f - Fixed order of method in line 12 &amp; remove comments * 6bcee648 - Undo assert method in line 22 [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4310&start_sha=f5471581aa31f4d4bc1f3faa4f032e269e67fe74)
    Toggle commit list
  • Đường Sỹ Hoàng @hoangds

    resolved all discussions

    Nov 13, 2019

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Nov 13, 2019
    Resolved by Đường Sỹ Hoàng Nov 13, 2019
    app/helpers/sessions_helper.rb 0 → 100644
    5 end
    6 # Returns the current logged-in user (if any)
    7 def current_user
    8 if session[ :user_id]
    9 @current_user ||= User.find_by( id: session[ :user_id])
    10 end
    11 end
    12
    13 # Return true if the user is logged in, false otherwise .
    14 def logged_in?
    15 current_user.present?
    16 end
    17
    18 # Logs out the current user
    19 def log_out
    20 session.delete( :user_id )
    • Son Do Hong @sondh commented Nov 13, 2019
      Master

      remove space

      remove space
    • Đường Sỹ Hoàng @hoangds

      changed this line in version 5 of the diff

      Nov 13, 2019

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4311&start_sha=6bcee6483242239be709e19b54b0559fb56f4474#59459d8ae6eb34ed02b9dd3b6d40207e2ab982ca_20_20)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Nov 13, 2019
    Resolved by Đường Sỹ Hoàng Nov 13, 2019
    app/controllers/application_controller.rb
    1 1 class ApplicationController < ActionController::Base
    2 2 protect_from_forgery with: :exception
    3 def hello
    3 include SessionsHelper
    4
    5 def hello
    • Son Do Hong @sondh commented Nov 13, 2019
      Master

      xóa hàm này, hoặc căn lề lại cho thẳng

      xóa hàm này, hoặc căn lề lại cho thẳng
    • Đường Sỹ Hoàng @hoangds

      changed this line in version 5 of the diff

      Nov 13, 2019

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4311&start_sha=6bcee6483242239be709e19b54b0559fb56f4474#7dc0dd94f601e507e2a20bad6adcf12a51caa380_5_4)
      Toggle commit list
    Please register or sign in to reply
  • Đường Sỹ Hoàng @hoangds

    resolved all discussions

    Nov 13, 2019

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Đường Sỹ Hoàng @hoangds

    added 2 commits

    • 7502d7d7 - Removed space
    • 43278a70 - Removed Hello function

    Compare with previous version

    Nov 13, 2019

    added 2 commits

    • 7502d7d7 - Removed space
    • 43278a70 - Removed Hello function

    Compare with previous version

    added 2 commits * 7502d7d7 - Removed space * 43278a70 - Removed Hello function [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4311&start_sha=6bcee6483242239be709e19b54b0559fb56f4474)
    Toggle commit list
  • Đường Sỹ Hoàng @hoangds

    added 1 commit

    • d1af87fe - Removed space in line 9

    Compare with previous version

    Nov 13, 2019

    added 1 commit

    • d1af87fe - Removed space in line 9

    Compare with previous version

    added 1 commit * d1af87fe - Removed space in line 9 [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4312&start_sha=43278a7064c302839232eba3d05dbd169479a2c9)
    Toggle commit list
  • Đường Sỹ Hoàng @hoangds

    added 6 commits

    • 94a89408 - Replaced negative operator
    • 1e017749 - Removed space
    • 19469656 - Removed space
    • 8e6c75e4 - Replacedwith double quote
    • fedd320b - Replaced with double quote
    • 86552822 - Replaced with double quote

    Compare with previous version

    Nov 13, 2019

    added 6 commits

    • 94a89408 - Replaced negative operator
    • 1e017749 - Removed space
    • 19469656 - Removed space
    • 8e6c75e4 - Replacedwith double quote
    • fedd320b - Replaced with double quote
    • 86552822 - Replaced with double quote

    Compare with previous version

    added 6 commits * 94a89408 - Replaced negative operator * 1e017749 - Removed space * 19469656 - Removed space * 8e6c75e4 - Replacedwith double quote * fedd320b - Replaced with double quote * 86552822 - Replaced with double quote [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4313&start_sha=d1af87fedc6bf1de5b2d4314bf679a12aafbedd2)
    Toggle commit list
  • Đường Sỹ Hoàng @hoangds

    added 1 commit

    • 8c72d08e - Replaced with double quote

    Compare with previous version

    Nov 13, 2019

    added 1 commit

    • 8c72d08e - Replaced with double quote

    Compare with previous version

    added 1 commit * 8c72d08e - Replaced with double quote [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4314&start_sha=86552822ce69ce0992a0b4c89861f28c8e02b53d)
    Toggle commit list
  • Đường Sỹ Hoàng @hoangds

    added 1 commit

    • bb6a7c05 - Removed space

    Compare with previous version

    Nov 13, 2019

    added 1 commit

    • bb6a7c05 - Removed space

    Compare with previous version

    added 1 commit * bb6a7c05 - Removed space [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4315&start_sha=8c72d08e4728515c7738e87ca2d9a5ea17ffc375)
    Toggle commit list
  • Đường Sỹ Hoàng @hoangds

    added 1 commit

    • 87259c26 - Added new function

    Compare with previous version

    Nov 13, 2019

    added 1 commit

    • 87259c26 - Added new function

    Compare with previous version

    added 1 commit * 87259c26 - Added new function [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/7/diffs?diff_id=4316&start_sha=bb6a7c056c994a0bdaa54e914341ce2de6e68bbc)
    Toggle commit list
  • Son Do Hong @sondh

    mentioned in commit bf9c39bf

    Nov 13, 2019

    mentioned in commit bf9c39bf

    mentioned in commit bf9c39bf1d5c4f82a5ae7c7ebfd74c1178162f3f
    Toggle commit list
  • Son Do Hong @sondh

    merged

    Nov 13, 2019

    merged

    merged
    Toggle commit list
  • Write
  • Preview
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 sign in to comment
Son Do Hong
Assignee
Son Do Hong @sondh
Assign to
None
Milestone
None
Assign milestone
Time tracking
3
3 participants
Reference: hoangds/sample_app!7
×

Revert this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
×

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.