views:

160

answers:

3

I'm a newby at web programming, and even newer to ruby on rails. What is the best way of asterisking out or "hiding" a new password entered by a user?

+5  A: 

You use an input field with the type "password":

<input type="password" name="ThePassword" />
Guffa
+11  A: 

Well it's not rails. It's html.

<input type="password" name="password" />

However with rails, you can use an helper and generate that html field automatically in your view :

<%= password_field :password %>
Damien MATHIEU
A: 

<input type="password">

But if you intend for this to be something people will actually use, keep in mind that security goes a lot further than that and can actually be quite tricky.

Chuck