Peter Vandenabeele wrote in post #1041264:
> On Tue, Jan 17, 2012 at 9:12 AM, Daisy Di <[email protected]> wrote:
>
>> times that is i want to change the value of other attributes, i must
>> update the password, if not ,the updating will fail.
>>
>> how can i update without updating the password ?
>>
>
> Check the User model
> (../app/models/user.rb)
> and see if there is a validation on password, present, could be e.g.
>
>   validates :password, :presence => true
>
> If you not requre a password to be present, you could deactive that
> line.
>
> Or, alternatively, you could make sure a password is filled in for the
> user.
>
> You can check these valdiation errors e.g. with this code
>
>   user.valid?  # false if some validation failed
>   user.errors.messages  # all the validations that failed
>
> HTH,
>
> Peter

HI Peter,
Thanks for your advise, i add
attr_accessor :password_confirmation ro user.rb and then delete
validates :password, :presence => true
and then , the problem is resolved.

-- 
Posted via http://www.ruby-forum.com/.

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