# Agile Web Development with Rails 8: B6.0(page 148)

**URL:** <https://forum.devtalk.com/t/agile-web-development-with-rails-8-b6-0-page-148/195013>\
**Category:** PragProg Customers\
**Tags:** book-agile-web-development-with-rails-8, errata\
**Created:** [14 April 2025 17:04 UTC](https://forum.devtalk.com/t/agile-web-development-with-rails-8-b6-0-page-148/195013 "2025-04-14T17:04:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bunnahabhain](https://forum.devtalk.com/user_avatar/forum.devtalk.com/bunnahabhain/32/543_2.png) [@bunnahabhain](https://forum.devtalk.com/u/bunnahabhain)\
**Post date:** [14 April 2025 17:04 UTC](https://forum.devtalk.com/t/agile-web-development-with-rails-8-b6-0-page-148/195013/1 "2025-04-14T17:04:28Z")

</div>

The file: app/views/line\_items/\_line\_item.html.erb was created in iteration D2, when we ran the generator: bin/rails generate scaffold LineItem product:references cart:belongs\_to

And it’s contents at the time were:

**Product:** \<%= line\_item.product\_id %\> 

**Cart:** \<%= line\_item.cart\_id %\> 

Page 148 shows the contents as:

 \<%= line\_item.quantity %\> × \<%= line\_item.product.title %\> \<%= number\_to\_currency(line\_item.total\_price) %\> 

I found this to be confusing. I suggest that it be noted that the existing code needs to be replaced with the new code.

---

<div class="post-metadata">

**Author:** ![rubys](https://forum.devtalk.com/user_avatar/forum.devtalk.com/rubys/32/3797_2.png) [@rubys](https://forum.devtalk.com/u/rubys)\
**Post date:** [15 April 2025 12:44 UTC](https://forum.devtalk.com/t/agile-web-development-with-rails-8-b6-0-page-148/195013/2 "2025-04-15T12:44:19Z")

</div>

This was done in iteration E1, and instead of x, you see ×

---

<div class="post-metadata">

**Author:** ![bunnahabhain](https://forum.devtalk.com/user_avatar/forum.devtalk.com/bunnahabhain/32/543_2.png) [@bunnahabhain](https://forum.devtalk.com/u/bunnahabhain)\
**Post date:** [16 April 2025 03:57 UTC](https://forum.devtalk.com/t/agile-web-development-with-rails-8-b6-0-page-148/195013/3 "2025-04-16T03:57:11Z")

</div>

Hmm… it looks like the text editor isn’t escaping the HTML snippet that I added properly, and as a result, not really demonstrating my point.

I realize that in iteration E1 we created a quantity column to the line\_items table, but in that iteration, we added it to the \_cart.html.erb partial. Later, in iteration E3, we replaced the list item-based approach with a table. But that was still in the cart partial.

In iteration F1, we cleaned up the cart partial by extracting the table-based code into the \_line\_item.html.erb partial as shown at the bottom of page 147/top of page 148.

What I found confusing was the book shows the change from the do loop to being a render,  
it doesn’t directly indicate that the code that was removed needs to replace the existing div-based code in the line\_item partial.

I eventually figured it out, but felt that it was worth mentioning, as I could see someone else stumbling here as well. I find that the book is very excellently detailed in the steps that need to be performed, but felt that it was missing something here.

Or maybe it’s just a “me” thing. Thanks!
