Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Model attribute is not being set when using devise?
- @user = User.new(:first_name => "Ken", :email => 'myemail@gmail.com', :password => 'apassword')
- @user.valid?
- puts "user's first name: #{@user.first_name}"
- puts @user.errors
- class User < ActiveRecord::Base
- # Include default devise modules. Others available are:
- # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
- devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable
- attr_accessible :email, :password, :password_confirmation, :remember_me
- validates_presence_of :first_name
- end
- attr_accessible :first_name, :last_name
Add Comment
Please, Sign In to add comment