0
0
Fork 0

Add ability to select all accounts matching search for batch actions (#19053)

This commit is contained in:
Eugen Rochko 2022-08-25 23:33:34 +02:00 committed by GitHub
parent d696f729f1
commit 5b0e8cc92b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 138 additions and 4 deletions

View file

@ -16,7 +16,11 @@ module Admin
def batch
authorize :account, :index?
@form = Form::AccountBatch.new(form_account_batch_params.merge(current_account: current_account, action: action_from_button))
@form = Form::AccountBatch.new(form_account_batch_params)
@form.current_account = current_account
@form.action = action_from_button
@form.select_all_matching = params[:select_all_matching]
@form.query = filtered_accounts
@form.save
rescue ActionController::ParameterMissing
flash[:alert] = I18n.t('admin.accounts.no_account_selected')