error on trying initial project
I'm trying out RoR for the first time. I've setup a application called wedding and in it I have created a model and controller for attendee. I have a db table attendees that has things like name, address, and phone which are all just varchar fields for now.
I figure it's a simple little project.
I can go to localhost:3000/attendee and I get the link for New Attendee. Ok, now when I click that link I get an error:
Quote:
You have a nil object when you didn't expect it!
The error occured while evaluating nil.type_cast_code
This is the code shown:
Code:
Extracted source (around line #4):
1: <h1>New <%= @scaffold_singular_name %></h1>
2:
3: <%= error_messages_for(@scaffold_singular_name) %>
4: <%= form(@scaffold_singular_name, :action => "create#{@scaffold_suffix}") %>
5:
6: <%= link_to "Back", :action => "list#{@scaffold_suffix}" %>
Ok, so I tried to put in a record in the db and go back to the listing page. I get the same error with different code.
Code:
Extracted source (around line #15):
12: <% for column in @scaffold_class.content_columns %>
13: <td><%= entry.send(column.name) %></td>
14: <% end %>
15: <td><%= link_to "Show", :action => "show#{@scaffold_suffix}", :id => entry %></td>
16: <td><%= link_to "Edit", :action => "edit#{@scaffold_suffix}", :id => entry %></td>
17: <td><%= link_to "Destroy", {:action => "destroy#{@scaffold_suffix}", :id => entry}, {:confirm => "Are you sure?"} %></td>
18: </tr>
Ok, so can anyone explain what's up with this? The code for the controller is just:
Code:
class AttendeeController < ApplicationController
model :attendee
scaffold :attendee
end
This is just like every demo I can find out there.
I appreciate any help I can get.