On 8/14/07, <b class="gmail_sendername">James Britt</b> <<a href="mailto:james.britt@gmail.com">james.britt@gmail.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have views that use a number of partials.<br><br>One partial defines the html "head" element, holding common meta<br>elements, css links, and the title element.<br><br><html mv:generate="advertiser/new.rhtml">
<br> <head mv:import_render=":partial => 'common/html_header'"><br>....<br><br><br>I want each page to have a distinct title, so the MasterView HTML has this:<br><br><br><title mv:content="@title">Fake Title</title>
<br><br>However, for this to work I need to assign a value to the @title<br>variable before it is processed.<br><br>I'm stumped. I can set this in the corresponding action in the<br>controller, but I'd prefer to set it in the view itself so that the
<br>designer can set the name.<br><br>I've tried adding a directive right after the html element but before<br>the call to "<head mv:import_render=":partial ... "<br><br>but MasterView seems to ignore that; it never appears in the resulting
<br>rhtml.<br><br>The MasterView docs do not indicate passing of arguments to<br>mv:import_render; I played around but that does seem to be an option as<br>it would be with a direct rhtml partial reference where you can use a
<br>hash to define partial variable values.<br><br><br><br>Suggestions?</blockquote><div><br><br></div></div>I have typically always defined my titles and page specifc data in my controller, but I can see the benefit of what you are trying to do. I have a couple ideas which might solve the problem. I'll explore those this morning and let you know my findings.
<br clear="all"><br>-- <br>Jeff Barczewski, MasterView core team<br>Inspired Horizons Ruby on Rails Training and Consultancy<br><a href="http://inspiredhorizons.com/">http://inspiredhorizons.com/</a>