On 23 February 2011 16:03, Bhasker Harihara <[email protected]> wrote:

Please don't top post, it makes it difficult to follow the thread.
Insert your reply at appropriate points in previous post.  Thanks

> 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

You still have not shown the complete error message as I asked.

Is the puts line immediately after the validates line or is it in
another method?  Show us a bit more code around the problem.

Colin


>
>
> On Wed, Feb 23, 2011 at 9:13 PM, Colin Law <[email protected]> wrote:
>>
>> On 23 February 2011 15:03, Bhasker Harihara <[email protected]>
>> 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 [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to