I’m going through DHH’s Agile Web Development with Rails for Rails 3.1. In chapter 14 they create a Users sign-in model/view/controller using the has_secure_password method. My user.rb file looks like this
class User < ActiveRecord::Base
attr_accessible :name, :password_digest, :password, :password_confirmation
validates :name, presence: true, uniqueness: true
has_secure_password
end
now when I go to localhost:3000/users/new I first get some kind of bcrypt-ruby error and then when I reload the page I get a undefined method `key?’ for nil:NilClass
I got (still gettin) that error with device. I’m changing a rails app from 2.3 to 3.2 and it seems that devise uses another type of encryption (I’m not sure I discovered 2 days ago). The only way I log in is using the console: