ruby on rails - devise signin using username or email -
below model. can explain me purpose of attr_accessor: signin here ?. have seen posts here stating attr_accessor creates getter , setters.
class user < activerecord::base # include default devise modules. others available are: # :confirmable, :lockable, :timeoutable , :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable attr_accessor :signin end in devise.rb file, have this.
config.authentication_keys = [ :signin ] questions:
- can explain me purpose of
attr_accessor: signinhere ?. - what
config.authentication_keys = [ :signin ]lead in device.rb file?.
this option enables pick authentication key. telling devise use accessor signin (that declared above).
default 1 used email:
config.authentication_keys = [ :email ]
Comments
Post a Comment