views:

172

answers:

4

As the title says: how can I use the Restful Authentication Plugin with Ruby on Rails. When I want to create a new user, it requires me to set the (wrong-named, confusing field) login (= username), email address and password. However, I want, like Facebook does, to require the user to enter only an email address and password, not a username. People will also login with this email address.

Can anyone help me?

+1  A: 

Can you hash the email to a unique user-name and just never expose the field to the user?

Stephen Furlani
But that's so messy, isn't there really no cleaner way?
Time Machine
A: 

Set the username and email to the same value?

BlueRaja - Danny Pflughoeft
A: 

What BlueRaja says, or use authlogic, which can easily be modified to support what you are trying to achieve.

Also, if you're going to do this, why not go the next step and support OpenId? It's available as an addon to authlogic.

corprew
+1  A: 

Restful Authentication includes generators that set up your models and migrations. You're free to edit those as you see fit.

You would just need to edit the validations in the User model for the login field. I'm not sure if the default users table migration include :null=>false for the login field, but that's a simple fix as well.

klochner