On Jun 11, 6:09 pm, JoshLucas <[email protected]> wrote:
> I am trying to put records into the database. Here is what I did at
> the console..
>
> ?>
> user = User.new(:name => "David", :hobby => "swimming", :age => 10)
>
> ?> user = User.new(:name => "David", :hobby => "swimming", :age => 10)
> => #<User id: nil, name: "David", hobby: "swimming", age: 10, email:
> nil, credit_card: nil, created_at: nil, updated_at: nil>>> user.save
>
> user.save
> => false
Once, you get this, you may know which is the error message by
calling:
user.errors
and its variant, see section 3.2 part 3 of lab.
You probably have a required field with is not supplied, or a supplied
field which does not respect the validation either in model or in the
database.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "ruby-on-rails-programming-with-passion" group.
To unsubscribe from this group, send email to
ruby-on-rails-programming-with-passion-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---