Can action buttons be added to dashboard table on activeadmin?
You can also try this:
ActiveAdmin.register Foo do
actions :all
index do
column :name
actions defaults: true do |foo|
link_to "Custom ACTION", custom_action_path(foo.id)
end
end
end
It worked for me to have more options than the already defined ones: View, Edit, Delete
Source: https://github.com/activeadmin/activeadmin/issues/53
table_for
is used to render a collection of objects which may not necessarily be ActiveRecord objects, so the action methods aren't available like they are in an index
action. However, you should be able to render your own actions with something like this:
column("View User") { |user| link_to "View", user_path(user) }
EDIT For multiple links you can wrap the link_to
s use Arbre's span tag:
column("View User") do |user|
span link_to "View", "/mypath"
span link_to "Edit", "/mypath"
span link_to "Delete", "/mypath"
end
I'm using ActiveAdmin 1.0.0.pre2 w/ arbre 1.0.2, I haven't tried it on earlier versions.