Skip to content

Commit 076ee87

Browse files
bivanalharcysjonathan
authored andcommitted
refactor(controller): update instead of update_attributes
1 parent e6eb62a commit 076ee87

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

spec/dummy/app/controllers/posts_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def edit
66

77
def update
88
@post = Post.find(params[:id])
9-
@post.update_attributes(post_params)
9+
@post.update(post_params)
1010
render(inline: "<%= @post.title %>")
1111
end
1212

spec/dummy/app/controllers/users_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def edit
66

77
def update
88
@user = User.find(params[:id])
9-
@user.update_attributes(user_params)
9+
@user.update(user_params)
1010
render(inline: "<%= @user.name %>")
1111
end
1212

0 commit comments

Comments
 (0)