On Jun 22, 8:37 am, Newb Newb <[email protected]>
wrote:
> the above simply saves what i enter into the field.why it doesnot
> consider the modelvalidation.

Please check the API docs (http://api.rubyonrails.org/) first for
things like this.

update_attribute: Updates a single attribute and saves the record
without going through the normal validation procedure.

I expect if you're calling update_attribute 12 times you're doing
something wrong; either call update_attributes with a hash, or set
each attribute individually:

@profileinfo.first_name = params[:profileinfo][:first_name]
@profileinfo.last_name = params[:profileinfo][:last_name]
@profileinfo.save

Even better, look into the use of attr_protected and attr_accessible
and just use a mass assignment:

@profileinfo.update_attributes(params[:profileinfo])

-Matt

--~--~---------~--~----~------------~-------~--~----~
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