search for: emailr

Displaying 1 result from an estimated 1 matches for "emailr".

Did you mean: email
2006 Jun 04
1
Problem with instance variables
...e database and I end up with two email variables: @email and email. validates_presence_of :user_name, :password, :password_confirmation, :email #:email was added by myself validates_uniqueness_of :user_name # email getter def email @email end #email setter def email=(eml) emailRE= /[\w._%-]+@[\w.-]+.[a-zA-Z]{2,4}/ if eml =~ emailRE @email = eml else # display error message end end Check a sample output from the console: >> july = User.new(:user_name => "july", :password => "secret", :password_confir mation => &quo...