Strange problem nested ajax list

Hi, I’m pretty new at rails like many of the others here and I’m having
a very strange problem.

I’m trying to make a dynamic Ajax menu (food menu) for a restaurant site
I’m developing to display the restaurant’s dishes. Here’s the basic
setup of the menu:

Lunch
-Appetizers
-menu item
-menu item
-Salads
-Entres

When a user clicks on lunch, I want the sections to appear, when the
user clicks on the section, I want the entre to appear, etc.

For the moment, for simplicity’s sake I’ve set it up so when the user
clicks on the lunch it loads a page(lunch_section) which renders a
partial(_section) of sll the menu items.

Here’s where it gets weird. I can get the thing to get the info from the
database and display it alright but it displays the entire layout in the
div. So I put render(:layout => false) in the controller under the
lunch_section model, I get an error message that says:

You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.each

Extracted source (around line #4):

1:


2: <%
3: odd_or_even = 0
4: for entre in @lunch_menu
5: odd_or_even = 1 - odd_or_even
6: %>
7:

Trace of template inclusion: /app/views/home/lunch_section.rhtml

RAILS_ROOT: …/config/…
Application Trace | Framework Trace | Full Trace

#{RAILS_ROOT}/app/views/home/_section.rhtml:4:in
_run_rhtml_home__section' #{RAILS_ROOT}/app/views/home/lunch_section.rhtml:1:in_run_rhtml_home_lunch_section’
#{RAILS_ROOT}/app/controllers/home_controller.rb:10:in `lunch_section’

This is driving me nuts. Where am I going wrong?