Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails ActiveAdmin : Multiple Index Tables

I understand that ActiveAdmin supports multiple index pages if the index pages are of different types (table, grid, block, blog), but I need to have two index table pages. I tried

index :as => :table do
...
end

index :as => :table do
...
end

but the index page only displays the first table. Is there a way to display both tables and rename the tabs?

Thanks

like image 360
user1438568 Avatar asked Mar 29 '14 17:03

user1438568


People also ask

What index renderers does active admin support?

Active Admin provides many different tools for you to build a compelling interface into your data for the admin staff. Built in, Active Admin has the following index renderers: All index pages also support scopes, filters, pagination, action items, and sidebar sections.

How do I sort objects in active record using active admin?

If you are creating a custom column, you may need to give Active Admin a hint for how to sort the table. You can pass the key specifying the attribute which gets used to sort objects using Active Record. By default, this is the column on the resource’s table that the attribute corresponds to.

How to display a filter for an attribute in active admin?

To display a filter for an attribute, use the filter method Out of the box, Active Admin supports the following filter types: :string - A drop down for selecting “Contains”, “Equals”, “Starts with”, “Ends with” and an input for a value. :numeric - A drop down for selecting “Equal To”, “Greater Than” or “Less Than” and an input for a value.

How to filter the active admin resource in ransack?

Let’s take the example above and use them to filter the Active Admin resource: Basically, that’s it, very straightforward. The only thing I’d like to note is the #preserve_default_filters! method which renders default filters. By default, Ransack allows you to filter by all attributes and relationships in the model.


1 Answers

Have you tried this.

Two pages for the same resource - ActiveAdmin

For example:

ActiveAdmin.register User, :as => 'Waitlist User' do
end

This way you dont need to create a custom index page.

like image 169
James Avatar answered Oct 13 '22 01:10

James