mercredi 25 août 2021

How to pass params through a checkbox tag

I have a simple form with a checkbox. I'm trying to pass a sale_id through the checkbox. However in the controller, the sale_id is not in the params hash.

I have tried different (unsuccessful) ways below:

<%= ff.check_box :refund, sale_id: sale.id, checked: true %>

<%= ff.check_box :refund, data: {sale_id: sale.id}, checked: true %>




Aucun commentaire:

Enregistrer un commentaire