Rails API/Pundit: Strong parameters with ActiveModelSerializers
问题 This section of Pundit section says that we could control which attributes are authorized to be updated. But it fails in case of the use of active_model_seriallizers gem: def post_params # originally geneated by scaffold #params.require(:post).permit(:title, :body, :user_id) #To deserialize with active_model_serializers ActiveModelSerializers::Deserialization.jsonapi_parse!( params, only: [:title, :body, :user] ) end If I modify the PostsController update action as Pundit suggested: def