NoMethodError

hey,

I am making an appointments page. It is not associated with any other
model. The model validations, migrations, controllers, views, and form
structure are in place but for some reason i keep getting:

NoMethodError in Appointments#new

Showing /Users/juangomez/Documents/Aptana Studio 3 Workspace/universal/
app/views/appointments/new.html.erb where line #3 raised:

undefined method `generated_methods?’ for #Class:0x000001020a3ce8
Extracted source (around line #3):

1:


2:

Create An Appointment


3: <%= form_for @appointment do |f| %>
4: <%= render :partial => “form”, :object => f %>
5: <%= f.submit “Create” %>
6: <% end %>

Please help me!!!

Hi Juan,

In the new action in your controller, do you have it creating an
actual @appointment object? For example:

class AppointmentsController < ApplicationController

… other stuff here, before filters, etc.

def new
@appointment = Appointment.new # do you have this?
end
end

My theory is that when rendering the view, it’s looking for the
@appointment instance variable which doesn’t exist yet because your
new action wasn’t creating it.

Double check that - good luck!