Forum: Ruby on Rails Dynamic Layout Positions and Extra Partials

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.
9baeaed902bbc7720f03e0952ec2389c?d=identicon&s=25 Sifix (Guest)
on 2009-01-12 08:20
(Received via mailing list)
I am thinking of developing a new project and I would like

1)from the admin areaof the site to control the partials I wan to be
displayed per page and theirs position.

2)These partials are not always related to the current controller/
action and needs extra models actions in order to be rendered e.g. a
user see a car listing page and I want in the sidebar (either left or
right - according from the settings in the admin area) to render a
partial let's say top 10 hot car offers..

I am concerned how could I control the preparation of the partials
within each controller from a specific action before it could be
rendered and set the position.

What I am thing is one of the following

1)to use before_filter create a Model e.g. page and call all the
necessary actions and database work for all needed partials and this
model   to store these settings in hashes into the page model.
E.g. {left=>[partial1 , partial2] , right=>[partial10]] and finally
make the @Page model available to the layout

2) to use the  embed_action as described here :
but I am concerned if I break the MVC as I will now move back and
forth from the view and my models

Do you have any better suggestion?
Thanks for your help..

 to be finally available to master layout  and set hashes with
9baeaed902bbc7720f03e0952ec2389c?d=identicon&s=25 Sifix (Guest)
on 2009-01-12 23:33
(Received via mailing list)
Anyones Ideas?
This topic is locked and can not be replied to.