Hi, having a few problems working out whats kicking off,
im using validates_presence_of :title in a models class
this seemed to work fine untill I used a custom new.rhtml
error message I am gaining is
NoMethodError in Recipe#create
Showing app/views/recipe/new.rhtml where line #15 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
15: <% @categories.each do |category| %>
17: <%= category.name %>
the def create controller looks somthing like this
def create @recipe = Recipe.new(@params['recipe']) @recipe.date = Date.today if @recipe.save redirect_to :action => 'list' else render_action 'new' end end
any suggestions to where im going wrong?