To conditionally set the a div to a style of hidden you can simply use mv:attr<br><br><div mv:attr=":style => #{(@open_tasks.empty?) ? 'display:none' : ' '}"><br> some html<br></div>
<br><br>basically just using an inline conditional to determine what to set the style to<br>If you were wanting to do this a lot, then a custom directive could be created to simplify the syntax.<br><br><br>As for the form_remote you can do something like this
<br><br><form mv:form_remote=":html => { :id => 'order_form_open' } "><br></form><br><br>We haven't updated the form directives to use the block style yet, but the above should do what you need.
<br><br>Have a Merry Christmas!<br><br>Jeff<br><br><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><br><br><br><div class="gmail_quote">On Dec 24, 2007 2:52 AM, Nico Ritsche <<a href="mailto:nico.ritsche@googlemail.com">nico.ritsche@googlemail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I'm trying to conditionally hide a div tag. The only way I could get it working<br>is like this:<br><br><div mv:if="!@open_tasks.empty?"><br> <br> <i>some html<br><br></i></div>
<br><br><div style='display:none' mv:else=""><br><br><i> same html</i><br><br></div><br><br>However, I don't like it, as I have to repeat the same html twice. Is there a <br>better way of doing it?
<br><br>Another thing: Can I create a form_remote_tag with a parameter using <br>mv:form_remote? So far I only made it working using form_remote_tag<br>directly like this:<br><br> {{{ form_remote_tag :html => { :id => 'order_form_open' } do}}}
<br><br>But I obviously like to avoid this as it shows up on the page.<br><br>Kind Regards,<br><font color="#888888">Nico<br>
</font><br>_______________________________________________<br>Masterview-users mailing list<br><a href="mailto:Masterview-users@rubyforge.org">Masterview-users@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/masterview-users" target="_blank">
http://rubyforge.org/mailman/listinfo/masterview-users</a><br></blockquote></div><br><br clear="all"><br>