516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
|
# File 'app/helpers/custom_table/application_helper.rb', line 516
def custom_table_batch_actions model
item = model.new
forms = []
forms.push (form_for(item, url: [:batch_edit, item.model_name.plural.to_sym], params: "ids[]", html: {class: "d-inline me-1"}, method: :post, "target": "remote-modal", data: {"turbo-frame": "remote-modal", "batch-actions-target": "form", "action": "batch-actions#submit"}) do |f|
concat(f.submit t("custom_table.batch_update"), class: "btn btn-success btn-sm my-1")
end)
forms.push (form_for(item, url: [:batch_destroy, item.model_name.plural.to_sym], params: "ids[]", html: {class: "d-inline"}, method: :delete, data: {"turbo-confirm": t("are_you_sure"), "batch-actions-target": "form", "action": "batch-actions#submit"}) do |f|
concat(f.submit t("custom_table.batch_destroy"), class: "btn btn-danger btn-sm my-1")
end)
forms.join("").html_safe
end
|