There is a button that adds 1 item to the basket:
<%= button_to 'Добавить в корзину', line_items_path(item_id: @item) %>
line_items_controller:
def create @cart = current_cart item = Item.find(params[:item_id]) @line_item = @cart.add_item(item)
Tell me how to implement the ability to set the quantity of goods to be added to the cart and how then this quantity can be changed in the cart.
UPD: Explanation: I mean how to associate with the button a text field in which the quantity of the goods will be entered?