lib/menu_builder/controller.rb in menu_builder-0.3.3 vs lib/menu_builder/controller.rb in menu_builder-0.4.0
- old
+ new
@@ -1,18 +1,23 @@
module MenuBuilder
module Controller
extend ActiveSupport::Concern
- def menu_item(name, options = {})
- instance_variable_set('@menu_item', name)
+ def menu_items(*items)
+ instance_variable_set('@menu_items', items)
end
+ alias_method :menu_item, :menu_items
module ClassMethods
- def menu_item(name, options = {})
+ def menu_items(*items)
+ options = items.extract_options!
+
before_filter(options) do |controller|
- controller.instance_variable_set('@menu_item', name)
+ controller.instance_variable_set('@menu_items', items)
end
end
+ alias_method :menu_item, :menu_items
+
end
end
end