Issue with multiple models on one form

So I'm a newbie to Rails and attempting to add multiple models to a

I found the Railscast for "Complex Forms, Part 1" at which is from
2007 and at the point where the moderator, Ryan, says "Let's take a
look at our code..." and refreshes the UI and in the Railscast we see
3 Tasks below the Project. However, when I refresh my project screen,
my code shows a "NoMethodError" in the Controller with an undefined
method for the prepsteps that were added. I'm not following the
Project/Task models, but am building a Recipe/Preparation Steps models
to learn Rails. Not sure what's up except my controller needs a method
somewhere. I'm using Rails 2.3.4. Any sugggestions?

Thanks in advance!!

From a quick glance at your code, I see that you use prepsteps in your controller and pre_steps in your models.

Hi Andrei,
Thanks for the quick feedback. I changed all prepsteps to prep_steps,
but now I'm getting an uninitialized constant error in my Recipe
controller for the following line:
    3.times { }

   NameError in RecipesController#new
   uninitialized constant Recipe::PrepStep

  NameError (uninitialized constant Recipe::PrepStep):
    app/controllers/recipes_controller.rb:28:in `new'
    app/controllers/recipes_controller.rb:28:in `times'
    app/controllers/recipes_controller.rb:28:in `new'
    -e:1:in `load'

I took out the 3.times & curly braces & tried just the
"" and I got the same error. I changed the
prep_steps to a number of variations (prepsteps, PrepSteps, PrepStep)
and got other various errors. Any thoughts? Is the underscore the
Thanks in advance!

Or as a more general question, I reviewed the Railscast mentioned
above & Ryan Bates says that the Railscast shows a way to do multiple
models in one form by keeping the code tucked in the models and not
the controllers. Since the Railscast was done in 2007, has a
preferred method of doing multiple models in one form emerged? Is it
preferable to put code in the models keeping the controllers light or
is it preferred to put the code in the controllers and keep the models
light? Or is this still a design preference for the developer to
Thanks in advance for enlightment!

To answer your question, I would check out the Wiki page from the Rails Best Practices gem: