I am following Michael Hartls rails tutorial . Here is the User model class .
class User < ActiveRecord::Base attr_accessible :name, :email, :password, :password_confirmation, :nick_name has_many :microposts, dependent: :destroy has_secure_password end The User table in database doesnt contain password/password_confirmation fields. It only has a
password_digestfield. I'm confused , Shouldn't I be using an attr_accessor method on fields that are not present in a table ? I thought that the code must look something like this :
class User < ActiveRecord::Base attr_accessible :name, :email, :password, :password_confirmation, :nick_name attr_accessor :password, :password_confirmation has_many :microposts, dependent: :destroy has_secure_password end Because password/password_confirmation are not present in table column , Is'nt attr_accessor required ? I'm thoroughly confused .