Dynamic Layout Positions and Extra Partials


#1

Hallo,
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

  1. to use the embed_action as described here :
    http://www.notsostupid.com/blog/2007/10/23/the-embedded-actions-plugin-for-rails/
    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
positions


#2

Anyones Ideas?