I look through one of the Rails lessons, during the user verification section, I always get an error message confirming that my password confirmations cannot be empty when editing / creating a user. I looked through the previous answers, and it looks like people were using attr_accessible, which was taken out of rails. I am full rails / web dev newb, so I'm not sure how to proceed. A look at HAML, sorry if this is a bad practice.
Model
class User < ActiveRecord::Base before_save { self.email = email.downcase } attr_accessor :name, :email validates_confirmation_of :password has_secure_password validates :name, presence: true, length:{ maximum: 16 } VALID_EMAIL_REGEX = /\A[\w+\-.] +@ [az\d\-.]+\.[az]+\z/i validates :email, presence: true, format: { with: VALID_EMAIL_REGEX }, uniqueness: { case_sensitive: false } validates :password, length: { minimum: 6 } has_one :profile has_many :posts end
View
= form_for(@user) do |f| - if @user.errors.any?
ruby ruby-on-rails password-confirmation
NoobException
source share