I have this:
ActiveAdmin.register User do
index do
column :email
column :name
column :role
column "Last Sign In", :last_sign_in_at
column :account
column "Units" do |user|
user.units.count.to_s
end
default_actions
end
The default_actions method should create the show, edit, and delete links. It shows them but the delete link is just a link to the show action:
admin/users/1
Specifications said it should create a delete link.
Dont know why it did that. So I tried an alternative:
column "Delete" do |user|
link_to "Delete", destroy_admin_user_path(user)
end
I get this error:
undefined method `destroy_admin_user_path' for <div class="index_as_table"></div>:ActiveAdmin::Views::IndexAsTable
I even tried adding this in routes:
match "/admin/users/:id/destroy(.:format) " => "admin/users#destroy"
Still got same error.
I included this in application.html.haml:
= javascript_include_tag :all
Still same problems as above.
Thanks for response