How can I use the variable data type as the title / name of the attribute that will be passed in POST?
The type is dynamic because it is actually the name of the column in the database.
$('body').on('click', '.setCompany', function(e){
var type = $('.modal.in').attr('data-type')
var id = $(this).attr('id')
$.post("/admin/purchase_orders_groups/8",
{ ${type}: id, _method: 'PUT' }
)
})