Skip to content

Commit fd062ee

Browse files
Update chapter03-presenting-users.adoc (#71)
The update function was missing in the example
1 parent 531b373 commit fd062ee

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

rails6/fr/chapter03-presenting-users.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,15 @@ class Api::V1::UsersController < ApplicationController
576576
end
577577
578578
# ...
579+
580+
def update
581+
if @user.update(user_params)
582+
render json: @user
583+
else
584+
render json: @user.errors, status: :unprocessable_entity
585+
end
586+
end
587+
579588
580589
def create
581590
@user = User.new(user_params)

0 commit comments

Comments
 (0)