03 May 2010, 15:00
John_bigger_pragsmall

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
Samr_small_pragsmall

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
  end

Sorry for any inconvenience.

  You must be logged in to comment