Curated list of episodes, bundled to help you on your learning path!
Videos of tech, infrastructure, hardware and software which non-instructional by nature.
Articles around software and tutorials.
Show your love and support while looking fancy.
Got a question or want to chat about a topic? Let's talk!
cart has many cart_item dependent: :destroy
<strong>Total price </strong> <%= order.cart_items.sum(&:total_price) %>
class OrdersController < ApplicationController
@order = Order.new(order_params)
current_cart.cart_items.each do |item|
@order.cart_items << item
@order.user = current_user
redirect_to orders_path, notice: "Thank you for your order"
@order = Order.find(params[:id])