-1
I am doing a test for an internship where I have an api and in this api I have to have the PUT method to change a user’s data by the id and a PATCH method that changes the partial data of a user but if it does not exist will create it.
def update
@user = ApiModel.find(params[:id])
@user.update(user_params)
end
What is the best way to make the PATCH so that if there is no user create it?