I’m working on an application with an ActiveAdmin backend and having a hell of a time getting it to render a fairly simple custom index view.
I have a number of ‘request’ records, which contain an email address and a book_id, by which they need to be grouped. I got as far as:
ActiveAdmin.register Request do
controller do
def index
@requests = Requests.group(:book_id).page
end
end
end
but this resulted in an error: ActiveSupport::OrderedHash can’t be coerced into Fixnum
I can create my own custom view in app/admin/requests/index.html.erb but then I lose the standard AA layout with the admin menu et all and can’t find a good way to include it.
I ended up doing this using a technique described on their Google Group, in which you just shove the user over to a custom action:
https://groups.google.com/d/msg/activeadmin/YgMzeYBXRno/GZ01Epyq5lcJ
Hacky, yes. I think this is a much needed feature, so hopefully someone can fork and add in support for the index view to take a block with custom content.