I have devise for authentication and i have not used validatable and i send the request and along to it i send a type. for example
http://localhost:3000/signup/new?type=twitter
in the above shown i have used type=twitterand in case it is twitter i do not want to validate email i.e., do not need validates_presence_of :email but in case i send type=email then i want to check presence of mail and whether mail has not already taken and check mail specified is valid or not? How can i do this? Please help me.
You could add the following to your controller:
However, I wouldn’t advise doing this as you would then have invalid data in your database. It would be best if you actually asked the user to enter his email when logging in with Twitter. This whole challenge is tackled by Ryan Bates on this episode about omniauth.
EDIT: I investigated a bit and if you check devise’s source code, you’ll notice that they now have this method called email_required?.
So all you have to do is override that method. How does you user model look? How are you allowing the user to login using Twitter? If you edit your question and show us that, we might be able to help you a little further.