Problems with application level variables


I created a class called MenuLink so I could create link objects for my
navigation menus. I want to instantiate the list and have it available
to all controllers in my applcation.

How I did it:

I created a file called menu_link.rb in app/models that contained

class MenuLink
  include Enumerable
  attr_accessor :name, :method

  @@items = []

  def initialize()

  def self.each(&block)

Then in my app/controllers/application.rb I put

  before_filter :config_defaults

  def config_defaults
    # More on this function later