module DynamicMenu module InheritableMenus mattr_accessor :menu @@menu = Hash.new def get_current_menu path = Rails.root.join('app/menus') full_path = path + "#{params[:controller]}/#{params[:action]}.rb" if File.exists?(full_path) load full_path "#{params[:action]}Menu".classify.constantize.new(self) end end end end