On using Omniauth and devise, for signing up or registrations we have Email,Password & Password Confirmation as default field, is it possible to have username, password and email and not the default one.
Asked
Active
Viewed 145 times
0
-
[Read devise wiki](https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-using-their-username-or-email-address). – Zabba Mar 18 '12 at 08:04
1 Answers
0
Yes, it is.
To do that, add this code to your config/initializers/devise.rb
config.authentication_keys = [ :username ]
However, it will not appear on the registration form. So you should move it to your application through the rails g devise:views
command and modify the registrations#new
form_for to the code above.
<%= f.label :username %><br />
<%= f.text_field :username %>
<%= f.label :email %><br />
<%= f.text_field :email %>
<%= f.label :password %><br />
<%= f.password_field :password %>

Rodrigo Flores
- 2,411
- 18
- 17