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 += "<ul>\n" a.each { |b| ret += "<li>\n" ret += link_to h(b.name), :action => b.controller +"/"+b.action, :id => b.name ret += "\n" ret += create_menu(b.submenu) ret += "</li>\n" } ret += "</ul>\n" end end