Women in Technology

Hear us Roar



Article:
  Rolling with Ruby on Rails
Subject:   Won't work with Rails 0.13 and WinXP
Date:   2005-08-15 08:36:14
From:   nathanmealey
After following the instructions in this article, I got several errors related to the categories-recipes linking. I then downloaded the source code, and am encountering the same errors.


1. Both the list and edit views fail on account of NULL values. Error: undefined method `name' for nil:NilClass
I.e. if a recipe has no category assigned yet (based on the way the article progresses, they are all like this initially) the list page won't display. If I cut out that line of code, line 18, then I can get to the edit page, but then that will fail.


2. The update action fails with the error: Couldn't find Recipe without an ID


I saw the solutions posted previously, but none of them worked, and this is the most recent version of the source code posted in Part 2 of this article.


Can anyone suggest help on this?

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Curt Hibbs photo Won't work with Rails 0.13 and WinXP
    2005-08-15 09:53:53  Curt Hibbs | O'Reilly AuthorO'Reilly Blogger [View]

    Most likely you've go recipes in the database that do not have a category id assign. Use MySQL-Front (or whatever tool you are using) to look at your recipes table and add valid catgeory ids wherever they are missing.