gregbell/active_admin — pull request #2838 by AndreyChernyh (2014-01-02 09:41:53+00:00)
Title: Allow to duplicate 'Batch Actions' button at the bottom

Switches 'Batch Actions' button selector from ID-based to class-based which allows to use multiple (duplicated) batch buttons. Duplicating button at the bottom speeds up batch operations on large tables (user don't have to scroll back to the top).

The following monkey-patch put into `app/config/initializers/active_admin.rb` does the trick:

```ruby
module ActiveAdmin
module Views
module Pages
class Index
def main_content
wrap_with_batch_action_form do
build_table_tools
build_collection
build_table_tools
end
end
end
end
end
end
```

`e.preventDefault()` is needed to prevent browser's default behavior when clicking on link with `href='#'` - it scrolls to the top