Administrate: Show search bar ?

Created on 22 Feb 2018  路  3Comments  路  Source: thoughtbot/administrate

Hi,

I've just setup the gem and it seems to be working fine. However, I don't have a search bar on indexes as there is on the demo:

https://administrate-prototype.herokuapp.com/admin/orders

Is there a particular setup to get the search bar ?

EDIT: I have a search bar on one model among 30, but I can't find why. I didn't do anything in particular for this model.

Most helpful comment

The problem for me was the COLLECTION_ATTRIBUTES in all my dashboards were defaulting to unsearchable fields, thus making the show_search_bar? method in Administrate::ApplicationController always return false and not show the search bar.

All 3 comments

Found the solution:

you need to customize the index controller action and pass search_term as true

I'm glad you figured out your problem!

Do you think this is something we should highlight in our docs? If so, I'd love to see a PR for it.

In the mean time, I'm going to close this specific issue.

The problem for me was the COLLECTION_ATTRIBUTES in all my dashboards were defaulting to unsearchable fields, thus making the show_search_bar? method in Administrate::ApplicationController always return false and not show the search bar.

Was this page helpful?
0 / 5 - 0 ratings