How to add a filter to Active Admin dashboard?

前端 未结 1 1849
南方客
南方客 2021-01-22 14:39

I want to add search functionality for a couple of my models on the Active Admin Dashboard page. How do I do that?

For a regular model I can do that using \"filter\", bu

1条回答
  •  北恋
    北恋 (楼主)
    2021-01-22 15:33

    Adding how I did it (following advice from Sjors), so that someone else may find it useful:

    in dashboards.rb:

      section "Search User", :priority => 4 do
        div do
          render "search_user"
        end
      end
    

    in views/admin/dashboard/_search_user.html.erb (Copied HTML of the user filter using firebug):

    0 讨论(0)
提交回复
热议问题