I am using on Rails 4 and ActiveAdmin, a batch action collection form to capture input from the user as they perform a batch action ( in this case a batch mailer). Is there a way to customize the labels for the inputs?
Say for example:
batch_action :email, priority: 1 , form: {main_subject: :text,
message: :textarea
} do |ids, inputs|
batch_action_collection.find(ids).each do |user|
ContactBatchMailer.contact_batch_email(main_subject, message,...
Instead of having "main_subject", I would like to display a better formatted text, like "Main Subject", or even better, something more descriptive than the variable name by itself.
I dug in the documentation https://github.com/activeadmin/activeadmin/blob/master/docs/9-batch-actions.md#batch-action-forms but I was not able to. Any suggestions will be much appreciated.
The form is rendered by modal_dialog.js.coffee, it should be possible to override and customize, for example see this declined pull request from @mmustala
You don't have to use a symbol for the form input name. A string will also work. So in your case you could do:
batch_action :email, priority: 1 , form: {'Main Subject': :text,
message: :textarea
} do |ids, inputs|
main_s = inputs['Main Subject']
...
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With