[Rails] Re: destroy_all function with nullify.
Matt Jones wrote in post #1011855:
> On Jul 20, 12:42am, abinila shanthi <li...@ruby-forum.com> wrote:
>>
> 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
How can I require the models in helper. Can you give me any example with
code..?
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home