I am new to Rails. I have following construction. Mainmenu in my project has many submenus. In defining @submenu is everything ok, but in finding @mainmenu not. The output is: Couldn't find Mainmenu without an ID
@submenu = Submenu.find(params[:submenu_id])
@mainmenu = Mainmenu.find(params[:id => @submenu.mainmenu_id])
How can i define @mainmenu so it is submenu`s upperclass?
I have Rails 2.