目前,我使用下面的代码传递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中做到这一点,或解决此问题的任何解决方法?