I am looking for a method that can generate a random string in the starting of the email field while updating the record.
def update
@user = User.find_by_id(4)
@user.email = #method to update email with random string
end
So if I have the email record abc@gmail.com
and I want to update it like this:
dssaakj123_abc@gmail.com
How it can be done in rails?