I actually got it working thanks to the help from a friend.. here is the code I used (ps. those CSS classes you see are for Foundation):
SimpleNavigation::Configuration.run do |navigation|
navigation.items do |primary|
def walktree(db, parent)
sub_items = pages_menu.where(parent_id:
db.id)
if sub_items.count > 0
s.dom_class="dropdown"
sub_items.each do |ddItem|
walktree(ddItem, s)
end
end
else
end
end
primary.dom_class='right'
#dynamic pages menus
pages_menu.where(parent_id: '0').each do |menu|
if menu.is_visible
walktree(menu, primary)
end
end
end
end