This is incredibly basic, but... I have a form that has fields defined for password and password_confirmation. it is passing in the following data Parameters: {"commit"=>"Change Password", "admin"=>{"password_confirmation"=>"beagle", "password"=>"beagle"}, "id"=>"3" I thought that processing the form data was a simple matter of referencing params[:password] - but that is a nil value. It appears to me that the password post data is within a hash within the hash. The data is there, but the reference form is unclear. What is the correct reference to the post data? e.g. how do I reference the :password field? Please forgive the very basic question. ---Michael -- 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 -~----------~----~----~----~------~----~------~--~---
well you can access that information from params[:admin][:password] the admin hash is because you probably put in your form like this <% = password_field "admin", "password" %> or in a form_for construct.. if you wanted to access just params[:password] you can do something like.. <%= password_field_tag "password", nil %> jason. On 6 Oct 2006, at 15:43, Michael Satterwhite wrote:> > This is incredibly basic, but... > > I have a form that has fields defined for password and > password_confirmation. it is passing in the following data > > Parameters: {"commit"=>"Change Password", > "admin"=>{"password_confirmation"=>"beagle", "password"=>"beagle"}, > "id"=>"3" > > I thought that processing the form data was a simple matter of > referencing params[:password] - but that is a nil value. It appears to > me that the password post data is within a hash within the hash. The > data is there, but the reference form is unclear. > > What is the correct reference to the post data? e.g. how do I > reference > the :password field? > > Please forgive the very basic question. > ---Michael > > -- > 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 -~----------~----~----~----~------~----~------~--~---
jason cale wrote:> well you can access that information from params[:admin][:password] > > the admin hash is because you probably put in your form like this <% > = password_field "admin", "password" %> or in a form_for construct..Jason, Thanks. The params field is a tad more involved (in a very good way) than it appears on the surface. The data is there, but the referencing needs to be done in the right way. I never cease to be amazed at the willingness of the people here to help people come up on rails. I do appreciate the help and promise to do my homework. ---Michael -- 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 -~----------~----~----~----~------~----~------~--~---
you''re very welcome :) On 6 Oct 2006, at 16:00, Michael Satterwhite wrote:> > jason cale wrote: >> well you can access that information from params[:admin][:password] >> >> the admin hash is because you probably put in your form like this <% >> = password_field "admin", "password" %> or in a form_for construct.. > > Jason, > > Thanks. > > The params field is a tad more involved (in a very good way) than it > appears on the surface. The data is there, but the referencing > needs to > be done in the right way. > > I never cease to be amazed at the willingness of the people here to > help > people come up on rails. I do appreciate the help and promise to do my > homework. > > ---Michael > > > > -- > 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 -~----------~----~----~----~------~----~------~--~---