Object passing for distributed model

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.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs