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
  • !6

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

Signup

×

Check out, review, and merge locally

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

git fetch origin
git checkout -b signup origin/signup

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 signup

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 3
  • Commits 3
  • Changes 11
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Nov 12, 2019
    Resolved by Đường Sỹ Hoàng Nov 12, 2019
    app/controllers/users_controller.rb
    1 1 class UsersController < ApplicationController
    2
    3 def show
    4 @user = User.find(params[:id])
    5 end
    6
    2 7 def new
    8 @user = User.new
    9 end
    10
    11 def create
    12 @user = User.new(user_params)
    13 if @user.save
    14 redirect_to @user
    15 flash[:success] = "Welcome to the Sample App!"
    16 else
    • Son Do Hong @sondh commented Nov 12, 2019
      Master

      indentation

      indentation
    • Đường Sỹ Hoàng @hoangds

      changed this line in version 2 of the diff

      Nov 12, 2019

      changed this line in version 2 of the diff

      changed this line in [version 2 of the diff](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/6/diffs?diff_id=4304&start_sha=f712e8de82e6eb894b685cd45325d6ab395b3c9c#28f48e0bc2718ddf87752d15b58a0016c13baf1c_16_11)
      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 12, 2019
    Resolved by Đường Sỹ Hoàng Nov 13, 2019
    app/controllers/users_controller.rb
    1 1 class UsersController < ApplicationController
    2
    3 def show
    4 @user = User.find(params[:id])
    • Son Do Hong @sondh commented Nov 12, 2019
      Master

      find và find_by trong trường hợp này có thể thay thế nhau được không?

      `find` và `find_by` trong trường hợp này có thể thay thế nhau được không?
    • Đường Sỹ Hoàng @hoangds commented Nov 12, 2019
      Master

      Theo em tìm hiểu, thì trong trường hợp này mình có thể dùng find_by. Và khi code mọi người khuyên dùng'fine_by' hơn.Vì khi xài 'find' nếu như nó không tìm thấy record trong database thì sẽ xuất ra exception dẫn tới server bị crash, lỗi 404.Còn khi dùng 'find_by' nếu như không tìm thấy record, thay vì xuất ra exception thì nó sẽ trả về giá rỗng 'nil' và server sẽ không bị crash.

      Theo em tìm hiểu, thì trong trường hợp này mình có thể dùng find_by. Và khi code mọi người khuyên dùng'fine_by' hơn.Vì khi xài 'find' nếu như nó không tìm thấy record trong database thì sẽ xuất ra exception dẫn tới server bị crash, lỗi 404.Còn khi dùng 'find_by' nếu như không tìm thấy record, thay vì xuất ra exception thì nó sẽ trả về giá rỗng 'nil' và server sẽ không bị crash.
    • Đường Sỹ Hoàng @hoangds

      changed this line in version 2 of the diff

      Nov 12, 2019

      changed this line in version 2 of the diff

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

    added 1 commit

    • 78cd61b7 - Fixed identation

    Compare with previous version

    Nov 12, 2019

    added 1 commit

    • 78cd61b7 - Fixed identation

    Compare with previous version

    added 1 commit * 78cd61b7 - Fixed identation [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/6/diffs?diff_id=4304&start_sha=f712e8de82e6eb894b685cd45325d6ab395b3c9c)
    Toggle commit list
  • Son Do Hong @sondh

    mentioned in commit c52b154e

    Nov 12, 2019

    mentioned in commit c52b154e

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

    merged

    Nov 12, 2019

    merged

    merged
    Toggle commit list
  • Đường Sỹ Hoàng @hoangds

    resolved all discussions

    Nov 13, 2019

    resolved all discussions

    resolved all discussions
    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
2
2 participants
Reference: hoangds/sample_app!6
×

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.