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
  • Nguyen Hoang Mai Phuong
  • sample_app
  • Merge Requests
  • !12

Merged
Opened Jun 22, 2021 by Nguyen Hoang Mai Phuong@phuongnhm 
  • Report abuse
Report abuse

Finish user edit, update, index, and destroy actions

×

Check out, review, and merge locally

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

git fetch origin
git checkout -b updating-users origin/updating-users

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 updating-users

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 5
  • Commits 2
  • Pipelines 2
  • Changes 19
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jun 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jun 23, 2021
    app/controllers/users_controller.rb
    1 1 class UsersController < ApplicationController
    2 include SessionsHelper
    3
    4 before_action :logged_in_user, only: [:index, :edit, :update, :destroy]
    5 before_action :correct_user, only: [:edit, :update]
    6 before_action :admin_user,
    7 only: :destroy
    • Thanh Hung Pham @hungpt commented Jun 22, 2021
      Master

      @phuongnhm Format lại chỗ này, sao nó bị xuống dòng vậy em?

      @phuongnhm Format lại chỗ này, sao nó bị xuống dòng vậy em?
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 2 of the diff

      Jun 23, 2021

      changed this line in version 2 of the diff

      changed this line in [version 2 of the diff](https://gitlab.zigexn.vn/phuongnhm/sample_app/merge_requests/12/diffs?diff_id=5282&start_sha=442df61467f391d73ec675005a1ebf10773b1ff6#28f48e0bc2718ddf87752d15b58a0016c13baf1c_7_6)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on the diff Jun 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jun 23, 2021
    app/controllers/users_controller.rb
    1 1 class UsersController < ApplicationController
    2 include SessionsHelper
    3
    4 before_action :logged_in_user, only: [:index, :edit, :update, :destroy]
    5 before_action :correct_user, only: [:edit, :update]
    6 before_action :admin_user,
    7 only: :destroy
    2 8 def show
    • Thanh Hung Pham @hungpt commented Jun 22, 2021
      Master

      @phuongnhm Add 1 line với cái before_action

      @phuongnhm Add 1 line với cái `before_action`
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jun 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jun 23, 2021
    app/controllers/users_controller.rb
    32 def edit
    33 @user = User.find(params[:id])
    34 end
    35
    36 def update
    37 @user = User.find(params[:id])
    38 if @user.update(user_params)
    39 flash[:success] = "Profile updated"
    40 redirect_to @user
    41 else
    42 render 'edit'
    43 end
    44 end
    45
    22 46 private
    23 47 def user_params
    • Thanh Hung Pham @hungpt commented Jun 22, 2021
      Master

      @phuongnhm chỗ này code cũ. Add thêm 1 line với private nha em.

      @phuongnhm chỗ này code cũ. Add thêm 1 line với `private` nha em.
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 2 of the diff

      Jun 23, 2021

      changed this line in version 2 of the diff

      changed this line in [version 2 of the diff](https://gitlab.zigexn.vn/phuongnhm/sample_app/merge_requests/12/diffs?diff_id=5282&start_sha=442df61467f391d73ec675005a1ebf10773b1ff6#28f48e0bc2718ddf87752d15b58a0016c13baf1c_47_47)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Jun 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jun 23, 2021
    app/views/users/edit.html.erb 0 → 100644
    1 <% provide(:title, "Edit user") %>
    2 <h1>Update your profile</h1>
    3 <div class="row">
    4 <div class="col-md-6 offset-md-3">
    5 <%= form_with(model: @user, local: true) do |f| %>
    • Thanh Hung Pham @hungpt commented Jun 22, 2021
      Master

      @phuongnhm Code từ Line 5-21 sẽ bị trùng lập lại với app/views/users/new.html.erb. Anh thấy trong sách có tách ra partial riêng. Xem lại nha em.

      @phuongnhm Code từ Line 5-21 sẽ bị trùng lập lại với `app/views/users/new.html.erb`. Anh thấy trong sách có tách ra partial riêng. Xem lại nha em.
    • Nguyen Hoang Mai Phuong @phuongnhm

      changed this line in version 2 of the diff

      Jun 23, 2021

      changed this line in version 2 of the diff

      changed this line in [version 2 of the diff](https://gitlab.zigexn.vn/phuongnhm/sample_app/merge_requests/12/diffs?diff_id=5282&start_sha=442df61467f391d73ec675005a1ebf10773b1ff6#f341a6263d9803e768a000b11a0a610ffacae2eb_5_5)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on the diff Jun 22, 2021
    Resolved by Nguyen Hoang Mai Phuong Jun 23, 2021
    config/routes.rb
    1 1 Rails.application.routes.draw do
    2 2
    3 get 'sessions/new'
    • Thanh Hung Pham @hungpt commented Jun 22, 2021
      Master

      @phuongnhm Sao remove cái này vậy em? Chap 10 chỗ nào yêu cầu vậy ?

      @phuongnhm Sao remove cái này vậy em? Chap 10 chỗ nào yêu cầu vậy ?
    Please register or sign in to reply
  • Nguyen Hoang Mai Phuong @phuongnhm

    added 1 commit

    • 170e6813 - fix style code

    Compare with previous version

    Jun 23, 2021

    added 1 commit

    • 170e6813 - fix style code

    Compare with previous version

    added 1 commit * 170e6813 - fix style code [Compare with previous version](https://gitlab.zigexn.vn/phuongnhm/sample_app/merge_requests/12/diffs?diff_id=5282&start_sha=442df61467f391d73ec675005a1ebf10773b1ff6)
    Toggle commit list
  • Nguyen Hoang Mai Phuong @phuongnhm

    resolved all discussions

    Jun 23, 2021

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Nguyen Hoang Mai Phuong @phuongnhm

    mentioned in commit c44a8299

    Jun 23, 2021

    mentioned in commit c44a8299

    mentioned in commit c44a829947ec45113df3d9d6a77d6249bee8c60e
    Toggle commit list
  • Nguyen Hoang Mai Phuong @phuongnhm

    merged

    Jun 23, 2021

    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
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
2
2 participants
Reference: phuongnhm/sample_app!12
×

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.