class Order < ApplicationRecord
has_many :line_items, inverse_of: :order, dependent: :destroy
accepts_nested_attributes_for :line_items,
allow_destroy: true,
reject_if: ->(attrs) { attrs["product_id"].blank? && attrs["quantity"].blank? }
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["wrapper", "template", "anchor"]
add(event) {