Forum: Ruby on Rails object passing for distributed model

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Manish S. (Guest)
on 2006-04-28 09:58
(Received via mailing list)
I'm still fairly novice when it comes to rails so i was hoping someone
could shed some light on the correct way to do things.

I have a central object that has :has_many relationships with 5 other
objects.  So i have one table, foo, and 5 other tables have foo_id to
associate each row with a foo object.

Now, i have a page that renders all the "foo" associations.  I chose to
render each piece in its own component.  So on the main page i have a
of render(:component... lines.

Given this, whenever i render a component, i pass it the foo object
in params {:foo => @foo}.  So it passes all the data associated with
foo object to each component.  This is killing my log files because if
any piece grows, it gets passed together in each render(:component...

Is this only bad for the log files?  Is there a trade of here that i
take up
more memory passing @foo around, but save on table joins?  I was
that i would reduce the amount of table joins i'd need to call by just
passing foo_id to each component.  Is this stupid?

Thanks so much.
Manish S. (Guest)
on 2006-04-29 00:21
(Received via mailing list)
This topic is locked and can not be replied to.