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 [email protected]
and I want to update it like this:
[email protected]
How it can be done in rails?