I''m trying to follow a tutorial, and I''m trying to enter in some data to the database through the script/console in the Terminal (OS X). Here is what I enter, and the error that follows: account.expenses.create(:paid_on => Time.now, :payable_to => ''Me'', :amount => 75.00) => #<Expense:0x24a4010 @new_record=false, @attributes={"account_id"=>5, "payable_to"=>"Me", "id"=>4, "amount"=>75.0, "paid_on"=>Thu Feb 15 21:32:35 CST 2007}, @errors=#<ActiveRecord::Errors:0x24a2f94 @base=#<Expense:0x24a4010 ...>, @errors={}>> Any ideas what might be going wrong here? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Yea, I just found that out from someone else. I''m totally new to ruby on rails, so seeing the word ''error'' a couple times in the output just made me think there was an error. I''ve got a lot to learn yet... Thanks for the response. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2007-Feb-16 04:20 UTC
Re: Error when inserting row through script/console
> I''m trying to follow a tutorial, and I''m trying to enter in some data to > the database through the script/console in the Terminal (OS X). Here is > what I enter, and the error that follows: > > account.expenses.create(:paid_on => Time.now, :payable_to => ''Me'', > :amount => 75.00) > > => #<Expense:0x24a4010 @new_record=false, @attributes={"account_id"=>5, > "payable_to"=>"Me", "id"=>4, "amount"=>75.0, "paid_on"=>Thu Feb 15 > 21:32:35 CST 2007}, @errors=#<ActiveRecord::Errors:0x24a2f94 > @base=#<Expense:0x24a4010 ...>, @errors={}>> > > Any ideas what might be going wrong here?Why do you think there''s a problem? Does the record not show up in the database? Cause the above output is what you would expect to get when it works... unless I''m just not reading it right. @errors is empty like you''d expect and you haven''t shown any actual error message that is occuring. What does your development.log show as far as SQL queries? -philip --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---