In my application, i need to change the default confirmation message on delete action. I have changed the default confirmation message for delete action on index page like,
index do
column :title
column :start_date
column :start_time
column :end_date
column :end_time
#actions
actions defaults: false do |post|
item "View", admin_content_path(post)
text_node " ".html_safe
item "Edit", edit_admin_content_path(post)
text_node " ".html_safe
item "Delete", admin_content_path(post), method: :delete, :confirm => "All grades, uploads and tracks will be deleted with this content.Are you sure you want to delete this Content?"
end
end
This is working fine on index page. I want to change the default confirmation message of delete action on show page also. It still showing default message like 'Are you sure you want to delete this?'
And how to change css of the confirmation dialog box of batch action in activeadmin?
Anyone know about this? Thanks.
First, you need to turn off the default generated links, you should use:
config.clear_action_items!
Then, you can create your own action items like this:
action_item only: :show do
link_to "Delete", { action: :destroy }, method: :delete, data: { confirm: 'All grades, uploads and tracks will be deleted with this content.Are you sure you want to delete this Content?' }
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