That's an easy one, really. You got a typo.
**
class Product ActiveRecord::Base
validates_presence_of :title, :description, :image_url,
validates_numericality_of :price
**
remove the last comma from the line
As far as I can see there is an extra ',' (comma) at the end of the first
statement, the statement just before your validates_numericality_of. I have
indicated that below within *[]*. Removing that should solve your issue.
class Product ActiveRecord::Base
validates_presence_of :title,
Hi--
I'm having trouble with a syntax error, which I'm working with on page
89 of Agile Web Development. I'm getting the following syntax error:
/Users/pdenlinger/Sites/depot/app/models/product.rb:4: syntax error,
unexpected tSYMBEG, expecting kDO or '{' or '('
validates_numericality_of :price
3 matches
Mail list logo