lib/avo/menu/builder.rb in avo-2.9.2.pre1 vs lib/avo/menu/builder.rb in avo-2.10.0
- old
+ new
@@ -3,10 +3,17 @@
def parse_menu(&block)
Docile.dsl_eval(Avo::Menu::Builder.new, &block).build
end
end
+ delegate :context, to: ::Avo::App
+ delegate :current_user, to: ::Avo::App
+ delegate :params, to: ::Avo::App
+ delegate :request, to: ::Avo::App
+ delegate :root_path, to: ::Avo::App
+ delegate :view_context, to: ::Avo::App
+
def initialize(name: nil, items: [])
@menu = Avo::Menu::Menu.new
@menu.name = name
@menu.items = items
@@ -58,20 +65,14 @@
end
# Add all the tools
def all_tools(**args)
Avo::App.tools_for_navigation.each do |tool|
- link tool.humanize, path: "#{root_path}/#{tool}"
+ link tool.humanize, path: root_path(paths: [tool])
end
end
# Fetch the menu
def build
@menu
- end
-
- protected
-
- def root_path
- Avo::App.root_path
end
end