Anyones Ideas?
On Jan 12, 2:36 am, Sifix <sif...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> 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
>
> 2) to use the embed_action as described here
:http://www.notsostupid.com/blog/2007/10/23/the-embedded-actions-plugi...
> 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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---