From nico.ritsche at googlemail.com Mon Dec 24 03:52:33 2007 From: nico.ritsche at googlemail.com (Nico Ritsche) Date: Mon, 24 Dec 2007 09:52:33 +0100 Subject: [Masterview-users] conditionally hiding a tag and form_remote with parameter Message-ID: Hi, I'm trying to conditionally hide a div tag. The only way I could get it working is like this:
*some html *
* same html*
However, I don't like it, as I have to repeat the same html twice. Is there a better way of doing it? Another thing: Can I create a form_remote_tag with a parameter using mv:form_remote? So far I only made it working using form_remote_tag directly like this: {{{ form_remote_tag :html => { :id => 'order_form_open' } do}}} But I obviously like to avoid this as it shows up on the page. Kind Regards, Nico -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20071224/ff8a5d88/attachment.html From jeff.barczewski at gmail.com Mon Dec 24 13:37:45 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Mon, 24 Dec 2007 12:37:45 -0600 Subject: [Masterview-users] conditionally hiding a tag and form_remote with parameter In-Reply-To: References: Message-ID: <19cda190712241037w60b4f1a3lb60948cf26975915@mail.gmail.com> To conditionally set the a div to a style of hidden you can simply use mv:attr
some html
basically just using an inline conditional to determine what to set the style to If you were wanting to do this a lot, then a custom directive could be created to simplify the syntax. As for the form_remote you can do something like this
We haven't updated the form directives to use the block style yet, but the above should do what you need. Have a Merry Christmas! Jeff -- Jeff Barczewski, MasterView core team Inspired Horizons Ruby on Rails Training and Consultancy http://inspiredhorizons.com/ On Dec 24, 2007 2:52 AM, Nico Ritsche wrote: > Hi, > > I'm trying to conditionally hide a div tag. The only way I could get it > working > is like this: > >
> > *some html > > *
> >
> > * same html* > >
> > However, I don't like it, as I have to repeat the same html twice. Is > there a > better way of doing it? > > Another thing: Can I create a form_remote_tag with a parameter using > mv:form_remote? So far I only made it working using form_remote_tag > directly like this: > > {{{ form_remote_tag :html => { :id => 'order_form_open' } do}}} > > But I obviously like to avoid this as it shows up on the page. > > Kind Regards, > Nico > > _______________________________________________ > Masterview-users mailing list > Masterview-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/masterview-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20071224/a32812cd/attachment-0001.html