Not sure what you mean by whether to user save or update_attributes. find_or_create_by_id will return a user object, that may or may not be persisted depending on whether validations passed (if it didn't exist already). You can find out by asking @userdata.persisted?
In any case, I recommend using first_or_create:
@userdata = User.where(:id => params[:id]).first_or_create(params[:user_object])
if @userdata.persisted?
# proceed
else
# errors in params, recover
end
UPDATE:
Kiddorails is right about the above code not updating the record if it existed prior to the call. The solution is actually pretty simple. Sorry I didn't get it right the first time:
@userdata = User.where(:id => params[:id]).first || User.new
@userdata.update_attributes(params[:user_object])
This works because update_attributes works just fine whether the record is new or persisted.