Re: Shouldn''t this insert in table?

Colin Law
Thu, 03 Sep 2009 11:10:25 -0000

2009/9/3 RVince
<rvince99-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>:
>
> It doesn;t save and the log reads:
>
> NoMethodError (undefined method `MyB'' for
#<MyAController:0x664f93c>):
>  app/controllers/mya_controller.rb:174:in `cxl''

If you look at the error carefully you will see that it is expecting
MyB to be a method of MyAcController for some reason.  Have a look at
the code around line 174 and work out what MyB is supposed to be at
that point.  If you cannot see the problem show us the code around the
failure.  I notice that it is MyAController, I would expect that to be
MyAsController but that may not be related to this problem.

Colin

>
> But I DO have a MyB model:
>
> class MyB < ActiveRecord::Base
> end
>
> as well as a MyBsController:
>
> class MyBsController < ApplicationController
> end
>
> Im confused regarding ActiveRecord here -- I''m just trying to add
a
> record into the table associate with MyB from MyAsController. -RVince
> >
>