Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def menu_from_model(model)
- model.find(:all).inject(root_item(model.to_s)) { |root, item| root.items << m_item(menu, item.name); root }
- end
- def menu_from_model(model)
- menu = root_item(model.to_s)
- model.find(:all).each do |item|
- menu.items << m_item(menu, item.name)
- end
- menu
- end
Add Comment
Please, Sign In to add comment