Thats great, thanks all for your help, that worked well.
On 9 Jun, 10:43, "Gareth Evans" <[EMAIL PROTECTED]> wrote:
> Beat you by 2 mins Christophe... but yours was quicker with the > instead of
> space :)
>
> On 6/9/07, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hey,
>
> > Camsoft a écrit :
> > > This is what I did and it works. But I was wondering if there was an
> > > easier way without having to use an anonymous function?
>
> > Certainly. As emphasized on the pages for each and map/collect, calling
> > the same function with identical arguments throughout an enum is an
> > optimized use-case: use invoke, as in the rewrite below.
>
> > $$('#idSelector > li').invoke('addClassName', 'myClass');
>
> > (btw, I used '>' instead of a simple space because you said you wanted
> > only "children" <li>'s to be affected. If you're going for descendants,
> > do use a simple space instead of the closing angular bracket.
>
> > --
> > Christophe Porteneuve aka TDD
> > [EMAIL PROTECTED] Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---