|
Use user.save! instead of user.save to force ActiveRecord to raise an error and its message. Maybe a model validation or database check constraint (NOT NULL, UNIQUE, etc) was stopping you. Also, you can always check the user.errors array whenever the method save return false. JoshLucas escribió: 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> --~--~---------~--~----~------------~-------~--~----~ 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... -~----------~----~----~----~------~----~------~--~--- |
- [rails-development] Problem with Rails Active Record Basics JoshLucas
- [rails-development] Re: Problem with Rails Active Record Ba... miga
- [rails-development] Re: Problem with Rails Active Record Ba... Mansay
