基本上,如果用户要编辑其顺序,我将尝试更新表单上的某些参数。但是,即使我在下拉菜单中尝试不同的值,它仍然会说相同的内容。
已经尝试将erb文件中的ruby代码插入不同的部分,以查看它是否可以更新我的订单,但是没有任何作用。
<form action="/coffees/<%=@coffee.id%>" method="POST">
<label>Change Flavor :</label>
<select name="flavor" id="flavor" value="<%=@coffee.flavor%>">
<option value="Fruity, Floral, Herbal">Fruity, Floral, Herbal</option>
<option value="Nutty, Caramel, Chocolate">Nutty, Caramel, Chocolate</option>
<option value="Spicy, Smoky, Woody">Spicy, Smoky, Woody</option>
</select> <br>
<label>Change Your Subscription:</label>
<select name="price" id="price" value="<%=@coffee.price%>">
<option value="Morning Pick-Me-Up 9.99/mo"> Morning Pick-Me-Up 9.99/mo</option>
<option value="The Filthy Casual 9.99/w">The Filthy Casual 9.99/wk </option>
<option value="The Addict 19.99/wk">The Addict 19.99/wk</option>
<option value="The Connoisseur 29.99/wk">The Connoisseur 29.99/wk</option>
</select> <br>
<input type="hidden" id="hidden" name="_method" value="PATCH">
<input type="submit" id="editbutton" value="Edit Coffee Order">
</form>```
Just has the same value of when I first picked from each dropdown menu.