This is what I have and it gives the error. validates :uname, :presence => true, :length => { :maximum => 50 }
puts "The name is set to #{user.uname}" But without the puts it updates the record into the databse. I think it is to do with scoping. If have this puts after make salt then I have no problem On Wed, Feb 23, 2011 at 9:13 PM, Colin Law <clan...@googlemail.com> wrote: > On 23 February 2011 15:03, Bhasker Harihara <harihara.bhas...@gmail.com> > wrote: > > Hi, > > > > My form_for is loading properly and also storing in the db. > > > > My show user is also fine. > > > > I just want to do a puts "user name is #{user.name}" this gives me > > > > NoMethodError in UsersController#new > > > > When I use self.name it give the same error > > > > but when I do the same at the console, it works fine. What is that I am > > missing. > > Show us the code that is failing and the full error message and tell > us which line it is failing on. Then we might be able to help. > > Colin > > -- > 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@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- 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@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.