0
votes

I have a RoR apps which uses Devise for user registrations and session management. As of now the users can signup using email and I use :confirmable in devise so that a confirmation email is sent and user account will be activated. But now I want to add a option to user to register either with email or username so that i have to confirm if he uses email and no confirmation is required if he is not providing email..

Can i achieve this using devise..?

Thanks in advance.

1

1 Answers

1
votes

Check out the bottom of this wiki page:

https://github.com/plataformatec/devise/wiki/How-To:-Add-:confirmable-to-Users

You should be able to do something like this:

protected
def confirmation_required?
  # Insert custom logic about confirmation only if a user has an email
end

Place this in your User.rb