Answer the question
In order to leave comments, you need to log in
How to make a mass update of parameters with validation?
I update the user fields, but with such an update, data validation does not occur
def update
if @current_user.update_attributes(user_params_for_update)
respond_200
else
render json: ErrorSerializer.serialize(@current_user.errors), status: :unprocessable_entity
end
end
Answer the question
In order to leave comments, you need to log in
You can use `update`. Here is another useful link on the topic: www.davidverhasselt.com/set-attributes-in-activerecord
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question