rendering multiple controllers to the same layout

I wanna display categories in the side pane and listings in the main, both divisions of the same layout How would I do that?

Using CSS probably.

Colin

Of course, the listings and categories are related ha ha I wanna show the listings for the category in the main and the sub-categories of that category in the side Problem is that there’s 2 controllers involved, I dunno how to invoke them both to render to the same layout either directly or through partials

(By the way, I have read a rails book, Agile Web Dev … and I’ve read chapters 7-10 from the tutorial you’ve been referring me to )

> I wanna display categories in the side pane and listings in the main,
> both
> divisions of the same layout How would I do that?

Using CSS probably.

Colin

Of course, the listings and categories are related ha ha I wanna show the
listings for the category in the main and the sub-categories of that
category in the side Problem is that there's 2 controllers involved, I
dunno how to invoke them both to render to the same layout either directly
or through partials

You are confused about the MVC model. You can access any model you
like in a controller and setup the data for both panes of the view.
What are the relationships between the various models (categories,
listings, sub-categories or whatever)? Getting those right is
crucial. If Category is a self referential model then it is important
to specify that correctly to save yourself a lot of work. Google for
rails self referential models if you don't know how to do it. If you
find yourself accessing category.parent_id in the code then you are
almost certainly not got it right.

By the way, it would not hurt to say thanks occasionally to those who
try to help you here.

(By the way, I have read a rails book, Agile Web Dev ... and I've read
chapters 7-10 from the tutorial you've been referring me to )

:slight_smile:

Colin

Thanks Colin, I realized that what I needed to do was create a new controller to pull data from both models for combined presentation in views

Id doesn't need to be a new model, it may be included in (for example)
the categories model if the dual pane view is the normal way to view
categories then put it in that controller.

Colin

Id doesn’t need to be a new model, it may be included in (for example)

the categories model if the dual pane view is the normal way to view

categories then put it in that controller.

Colin

What doesn’t need to be a new model? I’m gonna have to display listings from multiple categories in the main and children categories of the current category in the side i’m using

Sorry, I meant it does not need to be a new controller. You said in a
previous post " I realized that what I needed to do was create a new
controller to pull data from both models for combined presentation in
views".

Colin