I have a resource called Foobar, and on my /admin/foobars page I have a list of all foobars with the options view, edit, and delete appearing. I only want edit and delete to appear.
app/admin/foobars.rb
ActiveAdmin.register Foobar do
index do
# Here I have a bunch of columns for various fields in Foobar
# default_actions #=> Uncommenting this line would make view, edit, and delete appear.
actions :defaults => false do |foobar|
link_to 'Edit', edit_admin_foobar_path(foobar)
link_to 'Delete', admin_foobar_path(foobar), :method => :delete, :confirm => "Are you sure"
end
end
end
My problem is that this only shows the Delete option - Edit only shows up when I remove the second line. How do I get them to both show up under the same header?
ActiveAdmin.register Foobar do
index do
...
column "" do |resource|
links = ''.html_safe
links += link_to I18n.t('active_admin.edit'), edit_resource_path(resource), :class => "member_link edit_link"
links += link_to I18n.t('active_admin.delete'), resource_path(resource), :method => :delete, :confirm => I18n.t('active_admin.delete_confirmation'), :class => "member_link delete_link"
links
end
end
end
EDIT
Remove 'Show' link from ActiveAdmin default_actions
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