Thank you both Pepe and Bob. I appreciate it.

Andrew

On Jul 20, 1:22 pm, Bob <[email protected]> wrote:
> There is also the :on option for validations.  With combining :on
> with :if you could essentially set up several validations that are
> triggered by the specific pages.
>
> One validation to ensure presence_of :name, :email and :password :on
> => :create
> One validation to ensure presence_of :name :on => :update, :if
> => :email_and_password_are_not_being_updated
> One validation to ensure presence_of :email :on => :update, :if
> => :name_and_password_are_not_being_updated
> One validation to ensure presence_of :password :on => :update, :if
> => :email_and_name_are_not_being_updated
>
> You would have to write the methods for each :if option to inspect the
> attribute updates being sent by the form and other validations might
> be necessary if you have another page to allow edits for all three
> attributes.
>
> Hope this helps.
>
> Bob
>
> On Jul 19, 2:33 pm, Andrew Perkins <[email protected]> wrote:
>
> > Hello, I have a user model which stores a users name, email, and password.
>
> > I have a separate profile controller which lets the user edit his name,
> > email, and password from the user model.
>
> > I want the user to be able to update his name separately from his email as
> > well as change his password separately from when he changes his name or
> > email.
>
> > So on my profile edit page I have 3 forms. One for editing his name, one for
> > his email, then a third form to enter in his current password, what he wants
> > his new password to be, then a confirmation of that password.
>
> > My problem is that he can't edit just his name, when I submit the name form
> > the password validation kicks in and won't let me submit.
>
> > Can anyone give me some tips on how I could accomplish this please? Thank
> > you.

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