<% options = item.html_options(selected: selected)

# virtual nodes are only there for their children to be displayed in the menu
# and should not do anything on click, except if otherwise defined elsewhere
if url.blank?
  url = 'javascript:void(0)'
  options.reverse_merge!(onclick: 'return false;')
end %>

<%= link_to(content_tag(:span, h(caption), class: 'tooltip'), url, options) %>
