[Masterview-users] how to share header / layout across controllers

Ed Howland
Mon, 08 Jan 2007 16:52:19 -0000

On 1/7/07, Reza Primardiansyah <reza_prima77 at yahoo.com>
wrote:
> Thanks Jeff. Work nicely. But must be noted that
> script/server must be restarted for the change to
> appear.
>
>
> --- Jeff Barczewski <jeff.barczewski at gmail.com> wrote:
>
> > If you want to use the same layout across all
> > controllers then you edit the
> > list.html template (or which ever master template
> > which contains the
> > mv:generate="layouts/yourcontroller.rhtml") and you
> > will edit this to be
> > instead mv:generate="layouts/application.rhtml".
> > There would only be one of
> > these across all of your MasterView template files,
> > all others would use
> > import.
> >
> > In all your other templates you would use
> > mv:import="layouts/yourcontroller.rhtml"
> >

Just a small notation about the documentation on the MV site. It says
to use   @content_for_layout in the mv:replace (or mv:content
sometimes.) The Rails API says this is deprecated in favor of yield.
I''ve tested this with yield and the change is painless so far.

Basically, it seems they are eliminating the @content_for subsystem. I
guess to speed up rendering.

Ed

--
Ed Howland