Rails and Devise - Creating an initial user - missing encrypted password
I'm a little confused with how Devise is supposed to work with your initial admin user.
I can put a line like this in my seed file
User.create! :name => 'admin', :email => 'admin@examples.com', :password => 'p@ssw0rd!', :password_confirmation => 'p@ssw0rd!'
But when I check my sqlite database I notice it generates no encrypted_password. What am I doing wrong? Do I need to call another method? Not sure what Devise han开发者_Go百科dles here automatically for you.
UPDATE:
# Gemfile
gem 'rails', '3.0.10'
gem 'jquery-rails', '>= 1.0.12'
gem 'rmagick'
gem 'carrierwave'
gem 'cloudfiles'
gem 'devise'
gem 'fog'
gem 'acts-as-taggable-on', '~>2.1.0'
gem 'rails3-jquery-autocomplete'
gem 'sqlite3'
UPDATE 2
My devise settings of my User classdevise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
Please
- post the your logfile section for this issue
- post your config/initializers/devise.rb (settings only, without comments)
Hopefully this helps to get it!
And, ehm, did you run the generator (rails generate devise:install)?
精彩评论