On Jul 20, 12:42 am, abinila shanthi <[email protected]> wrote:
> Hi all ,
>
>            I am new to Ruby on Rails..
>            I have a requirement to handle the has_many functionality in
> helper itself. I have created the active_record object to the model
> dynamically. From the object I have tried to access the has_many
> functionality followed by destroy_all function.
>
>  I have posted my code and error which I received from my code . Please
> help me....
>

I'd love to, but this code is just about beyond help. Why on EARTH are
you doing this?

In any case, at least part of your problem is that the Class object
created by get_active_record doesn't wind up with a *name*, which is
confusing the association code (it's trying to generate the name of
the foreign key for the has_many). Try assigning the class to a
constant to sort that out.

As for the rest of the code, nearly *any* structure one could devise
would be clearer than this. If you're using AR but not Rails, the
*least* you could do would be to split out the model definitions into
files and 'require' them in all at the top...

--Matt Jones

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to