mirror of
https://github.com/varvet/pundit.git
synced 2022-11-09 12:30:11 -05:00
Updated read me for update_attribute deprecation warning
Signed-off-by: sudeeptarlekar <sudeeptarlekar@gmail.com>
This commit is contained in:
parent
d7c2e6e3bc
commit
998f2fd5db
1 changed files with 2 additions and 2 deletions
|
@ -692,7 +692,7 @@ You can now retrieve these attributes from the policy:
|
|||
class PostsController < ApplicationController
|
||||
def update
|
||||
@post = Post.find(params[:id])
|
||||
if @post.update_attributes(post_params)
|
||||
if @post.update(post_params)
|
||||
redirect_to @post
|
||||
else
|
||||
render :edit
|
||||
|
@ -714,7 +714,7 @@ However, this is a bit cumbersome, so Pundit provides a convenient helper method
|
|||
class PostsController < ApplicationController
|
||||
def update
|
||||
@post = Post.find(params[:id])
|
||||
if @post.update_attributes(permitted_attributes(@post))
|
||||
if @post.update(permitted_attributes(@post))
|
||||
redirect_to @post
|
||||
else
|
||||
render :edit
|
||||
|
|
Loading…
Add table
Reference in a new issue