目前,我使用下面的代碼傳遞PARAMS [:編號],以line_items創建用rails button_to helper生成隱藏的表單域數據?
<%= button_to 'Add to Cart', { controller: 'line_items', action: 'create', id: brick }, class: 'green radius nice button', method: :post, remote: true %>
然而,將追加在URL查詢ID PARAM這是我沒有想button_to做。我想要的是通過隱藏表單字段傳遞ID參數。我可以在button_to中做到這一點,或解決此問題的任何解決方法?