On 24 February 2011 12:36, Bhasker Harihara <[email protected]> wrote:
>
>
> On Thu, Feb 24, 2011 at 5:55 PM, Colin Law <[email protected]> wrote:
>>
>> On 24 February 2011 12:09, Bhasker Harihara <[email protected]>
>> wrote:
>> > ...
>> > Can you also expalin how validates get the values from the form_for
>>
>> It doesn't, your code does that and then calls save.  When you call
>> save the validations get called at appropriate points around the save
>> to check the data.
>>
>> Have a look at the Rails Guide 'ActiveRecord Validations and Callback'.
>>
>> Colin
>>
>> --
>
>
> I click "sign up" -> form_for gets displayed -> I click "save" then in
> user.rb validates takes place.  Am I correct to say this.

After you click 'save' it goes off to some controller action.
Somewhere in there it presumably calls @user.save
@user.update_attributes or one of the other ways that a record gets
saved.  It is at this point that the validations get called.

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