is_ancestor?

An article by Gaspard Bucher

return true if the current node is an ancestor of the argument

  1. action
  2. ajax
  3. API
  4. classes
  5. common attributes
  6. conditions
    1. blank?
    2. case
    3. ClassCondition
    4. else
    5. if
    6. is_ancestor?
    7. selenium
    8. when
  7. context
  8. dates
  9. display
  10. forms
  11. i18n
  12. meta
  13. SQLiss
  14. urls

return true if the current node is an ancestor of the argument

  • other node
see ancestors, zena 1.0

This is a Node method accessible with RubyLess:

<ul do='menus from root'>
  <li do='each' on_if='is_ancestor?(main)' do='link'/>
</ul>

The example above produces a menu where the “li” tag has class “on” if the shown menu item is an ancestor of the main node (the one in the url).