ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Rolling with Ruby on Rails, Part 2
Subject:   I'm stuck on the create method
Date:   2006-01-22 15:43:15
From:   H2Oman
When I include this

def create
@recipe = Recipe.new(@params['recipe'])
@recipe.date = Date.today
if @recipe.save
redirect_to :action => 'list'
render_action 'new'

I get this error when I go to url.../new
" SyntaxError in <controller not set>#<action not set>"
"app/controllers/recipe_controller.rb:19: formal argument cannot be an instance variable"

This error occures on all the pages; list, edit, ect. If I remove the create method then the error goes away.

1 to 2 of 2
  1. I'm stuck on the create method
    2006-10-20 13:09:49  asmasif [View]

  2. Curt Hibbs photo I'm stuck on the create method
    2006-01-22 18:24:49  Curt Hibbs | O'Reilly AuthorO'Reilly Blogger [View]

1 to 2 of 2