<div>Hi,</div>
<div>&nbsp;</div>
<div>first of all I think MasterView is a very useful tool. Good work!</div>
<div>&nbsp;</div>
<div>I&#39;m struggling to get the following working: I have a menu consisting</div>
<div>of several links. Dependent on the current controller action, the according</div>
<div>menu link should be styled differently than the other links.</div>
<div>My current solution is to do this for each menu option:</div>
<div>&nbsp;</div>
<div>&lt;li&gt;&lt;a mv:if=&quot;@current_page == &#39;home&#39;&quot; href=&quot;home.html&quot; mv:link_to=&quot;:action =&gt; &#39;index&#39;&quot;&gt;&lt;strong class=&quot;selected&quot;&gt;Home&lt;/strong&gt;&lt;/a&gt;
<br>&lt;a mv:else=&quot;&quot; href=&quot;home.html&quot; mv:link_to=&quot;:action =&gt; &#39;index&#39;&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;</div>
<div>..</div>
<div>..</div>
<div>&nbsp;</div>
<div>However, this doesn&#39;t work very nicely, as the static html shows each menu option twice.</div>
<div>Also it seems a bit awkward. Another idea I had is to use something like this:</div>
<div>&nbsp;</div>
<div>&lt;li mv:attr=&quot;:class =&gt; #{ if @selected ==&nbsp;&#39;home&#39; &#39;selected&#39; else &#39;not_selected&#39; end }&quot;&gt; &lt;a href=&quot;new.html&quot; mv:link_to=&quot;:action =&gt; &#39;index&#39;&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
</div>
<div>&nbsp;</div>
<div>This doesn&#39;t compile as the erb&nbsp;#{ if @selected ==&nbsp;&#39;home&#39; &#39;selected&#39; else &#39;not_selected&#39; end } isn&#39;t correct, </div>
<div>I could use erb directly I guess, like this</div>
<div><pre class="code">{{{ if @selected ==&nbsp;&#39;home&#39; }}}</pre><pre class="code">&lt;li class=&quot;selected&quot; &gt;...&lt;/li&gt;</pre><pre class="code">{{{ else }}}</pre><pre class="code">&lt;li class=&quot;not-selected&quot; &gt;...&lt;/li&gt;
</pre><pre class="code">{{{ end }}}</pre></div>
<div>But than I have the double links again.</div>
<div>&nbsp;</div>
<div>Is there a good way of achieving what I want? Conditional styling of page elements while&nbsp;keeping only one alternative in the static html</div>
<div>seems quite an essential thing to me. Anyway, I&#39;m new to rails and MasterView, so I might have overlooked some more obvious solution.</div>
<div>&nbsp;</div>
<div>Nico</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>