If you want to get the ancestors of an element you can call
Element.ancestors [1]. If you want to extract the same property of
every object of an array, you can use Enumerable.pluck [2].

So to construct a selector like the one Matt suggests, you can do:

var selector = 
element.ancestors().pluck("nodeName").invoke("toLowerCase").join("
> ");

Best,
-Nicolas

[1] http://prototypejs.org/api/element/ancestors
[2] http://prototypejs.org/api/enumerable/pluck

On Jan 11, 2008 7:41 PM, Pin <[EMAIL PROTECTED]> wrote:
>
> Thank you Greetz, but the idea is not touch anything, becouse of that
> I thinks in use DOM in this case.
>
> Thank you again.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to