On 8/14/07, <b class="gmail_sendername">James Britt</b> &lt;<a href="mailto:james.britt@gmail.com">james.britt@gmail.com</a>&gt; 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 &quot;head&quot; element, holding common meta<br>elements, css links, and the title element.<br><br>&lt;html mv:generate=&quot;advertiser/new.rhtml&quot;&gt;
<br>&nbsp;&nbsp; &lt;head mv:import_render=&quot;:partial =&gt; &#39;common/html_header&#39;&quot;&gt;<br>....<br><br><br>I want each page to have a distinct title, so the MasterView HTML has this:<br><br><br>&lt;title mv:content=&quot;@title&quot;&gt;Fake Title&lt;/title&gt;
<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&#39;m stumped.&nbsp;&nbsp;I can set this in the corresponding action in the<br>controller, but I&#39;d prefer to set it in the view itself so&nbsp;&nbsp;that the
<br>designer can set the name.<br><br>I&#39;ve tried adding a directive right after the html element but before<br>the call to&nbsp;&nbsp; &quot;&lt;head mv:import_render=&quot;:partial ... &quot;<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&#39;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>