Is it possible to created username based on his email automatically by using devise?
On register page, I have only email and password fields.
For example, when user create a new account with email randomname@gmail.com,
I’d like that his username automatically become a randomname. How can I accomplish it?
You can get the firstpart of the email adress with a regex like
^[^@]+, this will return everything from the start of the string before the@sign.To add the username to your database, you can use a callback.