user1183233
user1183233

Reputation: 41

Ruby on Rails: Devise

I've set up a scaffold for a hypothetical application with a users log in, but run into the following error when I try to create a user using the view

undefined method `encrypted_password=' for #<User:0x007fdffb0303a8>

Upvotes: 1

Views: 1446

Answers (3)

Fabio Russo
Fabio Russo

Reputation: 412

Be sure to have password and passord_confirmation as accessible attributes in your User model like this:

attr_accessible :email, :password, :password_confirmation, etc...

Upvotes: 0

varatis
varatis

Reputation: 14740

I agree with Sergio. But just to elaborate, follow the instructions below since it seems you may be new to Devise.

Did you do

gem install devise
rails generate devise:install
rails generate devise User
rake db:migrate
rails generate devise:views

?

The full instructions can be found here.

Upvotes: 3

Sergio Tulentsev
Sergio Tulentsev

Reputation: 230286

You probably forgot to run migrations against your database after you have installed devise. Or there was no such column in the migration.

Upvotes: 1

Related Questions