Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined local variable or method `unconfirmed_email' when registering users?

I just installed Devise in my app, configured the views and everything. However, when I click the sign up button I get this error:

NameError in Devise::RegistrationsController#create
undefined local variable or method `unconfirmed_email' for #<User:0x00000103721b28>

Why is this? Also, I'm using tlsmail to send emails out through my gmail business account. This might be a problem as well.

like image 993
varatis Avatar asked Jan 28 '12 22:01

varatis


2 Answers

unconfirmed_email is required for reconfirmable. For some reason this was enabled by default in config/intializers/devise.rb:

config.reconfirmable = true

All you have to do is set this to false.

like image 155
varatis Avatar answered Nov 18 '22 06:11

varatis


You miss unconfirmed_email column in db.

add t.reconfirmable in migrations and run rake db:migrate

or if you're using devise >= 2.0

t.string   :unconfirmed_email
like image 42
Fivell Avatar answered Nov 18 '22 06:11

Fivell