Women in Technology

Hear us Roar



Article:
  Rolling with Ruby on Rails
Subject:   Errors in the end
Date:   2005-07-08 13:24:40
From:   PGomez
Response to: Errors in the end

To get past the list.rhtml page, I omitted the line 18 that states


<td><%= recipe.category.name %></td>


Now it enables me to see the page, but still is not doing me any good since it did not solve the problem. With that, on the edit.rhtml I changed line 24 to:


<%= 'selected' if category.id == @recipe.category_id %>>


Instead of:


<%= 'selected' if category.id == @recipe.category.id %>>


Does that make sense with that second change? Thanks!

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • Errors in the end
    2006-10-04 05:02:32  rudyOnTheTrain [View]

    @recipe.category_id points to the foreign_key in the table recipe called category_id,so it makes perfect sense. @recipe.category.id points to a column that doesn`t exist in the table recipe.
  • Errors in the end
    2005-10-21 08:41:49  kFuQ [View]

    To get past the list.rhtml page, I omitted the line 18 that states


    <td><%= recipe.category.name %></td>

    chg to

    <td><%= recipe.category name %></td>