<div>Hi,</div>
<div> </div>
<div>first of all I think MasterView is a very useful tool. Good work!</div>
<div> </div>
<div>I'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> </div>
<div><li><a mv:if="@current_page == 'home'" href="home.html" mv:link_to=":action => 'index'"><strong class="selected">Home</strong></a>
<br><a mv:else="" href="home.html" mv:link_to=":action => 'index'">Home</a></li></div>
<div>..</div>
<div>..</div>
<div> </div>
<div>However, this doesn'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> </div>
<div><li mv:attr=":class => #{ if @selected == 'home' 'selected' else 'not_selected' end }"> <a href="new.html" mv:link_to=":action => 'index'">Home</a></li>
</div>
<div> </div>
<div>This doesn't compile as the erb #{ if @selected == 'home' 'selected' else 'not_selected' end } isn't correct, </div>
<div>I could use erb directly I guess, like this</div>
<div><pre>{{{ if @selected == 'home' }}}</pre><pre><li class="selected" >...</li></pre><pre>{{{ else }}}</pre><pre><li class="not-selected" >...</li>
</pre><pre>{{{ end }}}</pre></div>
<div>But than I have the double links again.</div>
<div> </div>
<div>Is there a good way of achieving what I want? Conditional styling of page elements while keeping only one alternative in the static html</div>
<div>seems quite an essential thing to me. Anyway, I'm new to rails and MasterView, so I might have overlooked some more obvious solution.</div><span class="sg">
<div> </div>
<div>Nico</div></span><a href="mailto:nico.ritsche@googlemail.com"></a>