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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -