Re: Shouldn''t this insert in table?

RVince
Wed, 02 Sep 2009 15:43:05 -0000

Ah, right..it really IS so much easier. Sorry for the dumb Q''s here
guys, been stuck in silly Javaland with the day job, and not thinking
the RubyRails-sense properly here. -Rvince

On Sep 2, 11:28 am, Colin Law
<clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
wrote:
> 2009/9/2 RVince <rvinc...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>:
>
>
>
> > in MyAController I want to create an instance of MyBModel, and have it
> > insert into the table for the MyB models
>
> > So, in a function in MyAController, I have
>
> > MyB myB = MyB.new
> > myB.something = whatever
> > myB.save
>
> > Shouldn''t that have inserted a new row into the table for MyB
models?
>
> Test the return value from save to see if it succeeded.  Look in the
> log (log/development.log) to see if any errors there.
>
> Colin
>
>