Debug models with the rails console -


not sure why happening:

2.0.0p247 :001 > user.column_names  => ["id", "user_name", "email", "password_digest", "created_at", "updated_at", "register_key", "culminated", "remember_token", "register_token_created_at", "profile_image", "licence_image", "first_name", "last_name", "nearest_town"]  2.0.0p247 :002 > user1 = user.create(user_name: 'james', email: 'james@killbots.com', first_name:'jj', last_name:'jj', nearest_town:'mordor')  => #<user id: nil, user_name: "james", email: "james@killbots.com", password_digest: nil, created_at: nil, updated_at: nil, register_key: nil, culminated: nil, remember_token: nil, register_token_created_at: nil, profile_image: nil, licence_image: nil, first_name: "jj", last_name: "jj", nearest_town: "mordor">  2.0.0p247 :003 > user1.update(user_name: 'killo')  => false  

rather solution, how go debugging problem console?

your user record not saved, because of failed validation. should check validity with:

user1.valid? 

and show errors:

user1.errors.full_messages 

Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -