Topic: Home page rendering with multiple models.

Hi All,
My page layout consists of a center section and two side bars.
I would like the home page to display the index action of three models (one in each section).
When any other action is requested (e.g. show, edit, new, delete) I would like the response to use the center section without any changes two the two side bars.

I have used the scaffold to create three models and have modified each index response to use content_for section_name and have inserted the associated named yields into the application layout file.

How do I DRY up all these generated files ?

Re: Home page rendering with multiple models.

Hi All again, I am trying to get to grips with rails 3.1 here.

Re: Home page rendering with multiple models.

It's tough to DRY up anything that contains the form_for block, like edit/new, and Rails 3 scaffolding already does the easiest thing by splitting out the fields in a partial.

Where do you feel you're seeing so much duplication that you feel WET.

Last edited by BradHodges (2011-10-21 19:02:54)

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Home page rendering with multiple models.

Thank you for the response. The time zone difference makes things a little awkward.

In addition to the three models I have a page controller, the index action of which builds the home page by replicating the index actions of each models own index action (First wet patch).

In the view for the home page I have to to do content_for for each of the models, left right and center (second wet patch).