On 24 February 2011 13:19, Bhasker Harihara <[email protected]> wrote:
> ...
> I mean in which variable validates gets the value from,
> The actual line in the program is
>
>  validates :uname,  :presence => true,
>                     :length   => { :maximum => 50 }

As I said that is not the line that does the validations, it just
registers that they are to be done.  Did you work through the Rails
Guide as I suggested, that should make it clear.

The validation gets called when you do @user.save or something
similar.  The attributes for both the validation and the save are in
@user in this case.

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.

Reply via email to