Batch Action Partial Example
Assuming a Post resource (in the default namespace) with a `mark_published` batch action, we set the partial name and a set of HTML data attributes to trigger a modal using Flowbite which is included by default.
Note that you can use any modal JS library you want as long as it can be triggered to open using data attributes. Flowbite usage is not a requirement.
```ruby
batch_action(
:mark_published,
partial: "mark_published_batch_action",
link_html_options: {
"data-modal-target": "mark-published-modal",
"data-modal-show": "mark-published-modal"
}
) do |ids, inputs|
# ...
end
```
In the `app/views/admin/posts` directory, create a `_mark_published_batch_action.html.erb` partial file which will be rendered and included automatically in the posts index admin page.
Now add the modal HTML where the `id` attribute must match the data attributes supplied in the `batch_action` example. The form must have an empty `data-batch-action-form` attribute.
```
<%= form_tag false, "data-batch-action-form": "" do %>
<% end %>
```
The `data-batch-action-form` attribute is a hook for a delegated JS event so when you submit the form, it will post and run your batch action block with the supplied form data, functioning as it did before.
- Deeply nested submenus has been reverted. Only one level nested menu, e.g. `menu parent: "Administrative"`, is supported.
- Removed `Panel#header_action` method.
- Removed `index_column` method from index table.