small medium large xlarge

03 May 2010, 15:00
John Ranaudo (5 posts)

On page 132 is anyone having problems adding the total_price method to the cart model? I’m getting an error, “undefined method ‘total_price’” from the cart view show.html.erb.

Thanks, John

03 May 2010, 16:29
Sam Ruby (584 posts)

Next beta of the book will have the following addition to app/models/line_item.rb:

  def total_price
    product.price * quantity

Sorry for any inconvenience.

  You must be logged in to comment