lib/caboodle/kit.rb in caboodle-0.2.19 vs lib/caboodle/kit.rb in caboodle-0.2.20
- old
+ new
@@ -97,24 +97,22 @@
def menu display, path=nil, &block
#todo proper slugify
slug = display.downcase.gsub(" ","-").gsub("'","")
path = "/#{slug}" unless path
- path = "/" if Site.home_kit == self.to_s.gsub("Caboodle::","")
+ puts "set /#{slug} - menu items: #{Settings.menu_items.inspect}"
+ path = "/" if Site.home_kit == self.to_s.gsub("Caboodle::","") && !Settings.menu_items.include?("/")
Caboodle::MenuItems << {:display=>display, :link=>path, :kit=>self}
- self.before {@title = display}
if block
self.get path, &block
else
eval "self.get '#{path}' do
+ @title = '#{display}'
haml :#{slug.gsub("-","_")}
end"
end
- @@has_menu = true
- end
-
- def has_menu?
- defined?(@@has_menu)
+ Settings.menu_items ||= []
+ Settings.menu_items << path
end
def required keys
if keys.class == Array
keys.each do |k|
\ No newline at end of file