Hi!<br><br>Today I resolved my problem with layouts of Javascript using a &quot;single&quot; core modification and like to share it with you.<br><br>My problem is in merb-0.5.3 and i don&#39;t know if this really is a problem or is a option of Merb developers.<br>
<br>But, to solve <b>my</b> case. To use layouts of javascript files in merb 0.5.3 only change that line:<br><pre style="margin-left: 40px; font-family: arial,sans-serif;"><span class="ruby-keyword kw">if</span> <span class="ruby-identifier">engine</span>.<span class="ruby-identifier">exempt_from_layout?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier ruby-symbol">:layout</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier ruby-symbol">:none</span> <span class="ruby-operator">||</span> [<span class="ruby-identifier ruby-symbol">:js</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@_template_format</span>)</pre>
in <span class="ruby-comment cmt">File lib/merb/mixins/render.rb,<br><br>to<br></span><pre style="margin-left: 40px; font-family: arial,sans-serif;"><span class="ruby-keyword kw">if</span> <span class="ruby-identifier">engine</span>.<span class="ruby-identifier">exempt_from_layout?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier ruby-symbol">:layout</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier ruby-symbol">:none</span><span class="ruby-ivar"></span></pre>

<span class="ruby-comment cmt"><br>:)<br></span><br><div class="gmail_quote">On Tue, Mar 18, 2008 at 5:52 PM, Dirceu &lt;<a href="mailto:dirceuu@gmail.com" target="_blank">dirceuu@gmail.com</a>&gt; wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I&#39;ve tryed to use the same logic in html layouts to handle javascript files without success.<br>


All I need is not repeat javascript code in various erb templates that have 90% of identical code.<br><br>- I can&#39;t use more than 1 js file.<br>
- If isn&#39;t a way to do this like erb can do in html, what&#39;s the best way to &quot;include&quot; a file in another using Merb?<br clear="all"><font color="#888888"><br>-- <br>from Brazil, Dirceu Pauka<br>a ninja of the boo-box team<br>


<a href="http://boo-box.com" target="_blank">http://boo-box.com</a><br>
<br>Please don&#39;t print this e-mail<br>Evite imprimir este e-mail
</font></blockquote></div><br><br clear="all"><br>-- <br>from Brazil, Dirceu Pauka<br>a ninja of the boo-box team<br><a href="http://boo-box.com" target="_blank">http://boo-box.com</a><br><br>Please don&#39;t print this e-mail<br>

Evite imprimir este e-mail