Reputation: 372
I am just exploring active admin but got stuck in adding an action button ( approve / reject ) in the index view. Here is the code snippet. In, app/admin/user.rb
index do
selectable_column
id_column
column :email
column :current_sign_in_at
column :sign_in_count
column :created_at
column '' do
# Here is where I need a button to "Approve / Reject" the user(s).
end
actions
end
Upvotes: 0
Views: 634
Reputation: 4639
You got stuck adding an action button ...
Here's how to do it
# app/admin/some_class.rb
ActiveAdmin.register SomeClass do
action_item :approve, only: :index do
link_to "Approve", some_path
end
index do
selectable_column
id_column
column :email
column :current_sign_in_at
column :sign_in_count
column :created_at
actions
end
end
Upvotes: 1
Reputation: 2927
You can use link_to inside the block
column "Approve / Reject" do
link_to("Approve / Reject", some_path)
end
Upvotes: 1