On Jan 12, 2008 9:58 AM, Gareth Evans <[EMAIL PROTECTED]> wrote:
> To tidy that up, what if you push or unshift (not sure which you need) the
> current element before the pluck but after the anscestors...
> that should get the current element into the chain.
Good idea. It'd be nice if Array methods like unshift and push
returned this (Function#wrap to the rescue! :))
-Nicolas
>
> Gareth
>
>
>
> On Jan 12, 2008 11:13 AM, Justin Perkins <[EMAIL PROTECTED]> wrote:
> >
> >
> > > var selector =
> element.ancestors().pluck("nodeName").invoke("toLowerCase").join("
> > > > ");
> >
> > Quite a handy little piece of code there Nicolas, with a slight
> > modification to append the element ID and that'd be a great Element
> > utility method.
> >
> > -justin
> >
> >
> >
> > > >
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---