I would like the code to pull information from the cart api and store it in a hash with simple keys, then iterate over the hash to make new html elements as needed per item. Every item that I need to pull has the following: id
, Name
, and Price
.
products.each do |product|
@product_card = [
{
:id => "#{product['product_id']}",
:name => "#{product['name']}",
:price => "#{product['price']}"
}
]
I want to store the information in a hash so I can iterate over the info on the fly like so:
<% @product_card.each do |Need help here, Need help here| %>
<html p><% :id %></html p>
<html p><% :name %></html p>
<html p><% :price %></html p>
I stay hopeful for any feedback you can offer.