My application controller has this:
after_filter :set_var
def set_var
@categories = Categories.all
end
My navigation config has this (snippet):
primary.item :equipment, 'Equipment', '#', do |equip|
@categories.each do |cat|
end
end
But I always get a "undefined method `each' for nil:NilClass"
What am I doing wrong? Is it just not possible to do this? It seems the before_filter is not actually being called before the navigation script.
I tried again with the before_filter just setting @test = "Test", and making a menu item with that, and I got a similar error
Thanks for the help