Hi, newbie here. :) i have this form on a test rails app: <% form_for @user do |f| %> <%= f.error_messages %> <p> <%= f.label :username %><br /> <%= f.text_field :username %> </p> <p> <%= f.label :email %><br /> <%= f.text_field :email %> </p> <p> <%= f.label :password %><br /> <%= f.password_field :password %> </p> <p> <%= f.label :password_confirmation %><br /> <%= f.password_field :password_confirmation %> </p> <p><%= f.submit %></p> <% end %> I am following this railscast here http://media.railscasts.com/videos/160_authlogic.mov Half way he changes password_field and also ads password_confirmation and it works great in the video but for me i get this error undefined method `password_confirmation'' for #<User:0x1036485d0> how come that password_confirmation method is not defined? any tips? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Aug 17, 2010 at 9:58 PM, oliver torres <senortowers-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am following this railscast here > http://media.railscasts.com/videos/160_authlogic.mov > Half way he changes password_field and also ads password_confirmation > and it works great in the video but for me i get this error > undefined method `password_confirmation'' for #<User:0x1036485d0> > > how come that password_confirmation method is not defined? > any tips?In the user model there should be something like: attr_accessor :password_confirmation -- Greg Donald destiney.com | gregdonald.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Aug 17, 2010 at 22:58, oliver torres <senortowers-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> it works great in the video but for me i get this error > undefined method `password_confirmation'' for #<User:0x1036485d0> > > how come that password_confirmation method is not defined? > any tips?Most likely the method/data/whatever is not defined because the actual final saved user, does not need to store it. It''s only useful when [re]setting the password. Off the top of my pointy little head, I''d guess a before_save filter (to check whether it matches the actual password, and if so then remove it, else flag the record invalid) is what you want. -Dave -- Specialization is for insects. -RAH | Have Pun, Will Babble! -me Programming Blog: http://codosaur.us | Work: http://davearonson.com Leadership Blog: http://dare2xl.com | Play: http://davearonson.net * * * * * WATCH THIS SPACE * * * * * | Ruby: http://mars.groupsite.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.