title is an attribute of the table recipes.
here is what I have :
class Recipe < ActiveRecord::Base
validates_length_of :title, :within => 6…20
validates_uniqueness_of :title, :message => “already exists”
But when I try to add a new recipe I get this error :
NoMethodError in Recipe#create
Showing app/views/recipe/new.rhtml where line #17 raised:
You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.each
Extracted source (around line #17):
17: <% @categories.each do |category| %>
19: <%= category.name %>
Application Trace | Framework Trace | Full Trace
View this message in context:
Sent from the RubyOnRails Users forum at Nabble.com.