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. Regards, Ryan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hrmmm... like in the controller, if it''s a User that has a password, you can''t just do: def new @user = User.new @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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 4/21/08, Ryan Klein <ryan-G0Kupp6c8GGaMJb+Lgu22Q@public.gmane.org> wrote:> > 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.You can set it in the controller when you make a new instance of the object: @foo = Foo.new( :passwd => passwd ) -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
user form_for method http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html On Apr 22, 3:31 am, Ryan Klein <r...-G0Kupp6c8GGaMJb+Lgu22Q@public.gmane.org> wrote:> 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. > > Regards, > > Ryan--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---