Automatically filling a text box

Well I am new to Rails and I'm looking to find out how to automatically fill a text box with a randomly generated password. I can generate and display the password just fine but I cannot find a way to have the page load with the password already in the text field.




like in the controller, if it's a User that has a password, you can't just do:

def new   @user =   @user.password = 'ryans_text'   respond_to do |format|     format.html # new.html.erb     format.xml { render :xml => @user }   end end

and have 'ryans_text' appear in the password field of the form???

Generally, you'll not want passwords in a plain text_field... and a password_field won't show the text on purpose.

You can set it in the controller when you make a new instance of the object:

@foo = :passwd => passwd )

user form_for method