what am i missing here . the line a.each { |B| fails with the error
NoMethodError: You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.+
from (irb):4:in `create_menu’
from (irb):17
but a is an array of menu objects… HELP!!!
def create_menu(menu)
a = Menu.find(:all, :conditions => “menu = '” + menu + “’”, :order
=> “‘order’” )
if a.size then
ret += “
- \n”
- \n”
ret += link_to h(b.name), :action => b.controller
+"/"+b.action, :id => b.name
ret += “\n”
ret += create_menu(b.submenu)
ret += “ \n”
a.each { |b|
ret += “
}
ret += “
end
end