passwords - how to NOT update a field Ruby on Rails -
i'm newbie in rails. how put validated on password field. specified on create , used allow_blank method. everytime update still creates nil in password field. help?
validates :password, :presence => { :on => :create }, :confirmation => true, :length => { :within => 8..40}, :allow_blank => true,
try this:
validates :password, :presence => { :if => :new_record? }, :confirmation => true, :length => { :within => 8..40 }
Comments
Post a Comment