comfortable-mexican-sofa
comfortable-mexican-sofa copied to clipboard
Feature request: add search to files library
I would like to discuss a little feature for the Comfy file library. When there are many images or files it would be great to have a search or filter field. It would be as simple as an input field and a button search next to it. I would place the field next to the upload new file button. Extra bonus points would be to implement this via XHR. Means the list is being updated after adding some letters into the search box.
What are your thoughts?
Cheers
Andy
I think it's a great idea. Doing a simple LIKE search on labels could do the job
@GBH I am in the process of implementing this, with a LIKE search matching labels and descriptions. I have a few questions though:
- Why does comfy use
params[:source]
instead of switching on the request format (json, html, …)? Is it because of redactor or are there other reasons? - What is your preferred solution for the search form building? Manual construction with
form_tag
is simple and needs no new dependencies, but it is also annoying manual work to keep the form in sync with the request. Gems like ransack offer simple-to-use alternatives, but might be overkill for “just one” search feature. - Users might want to filter by label/description and category at once. That would mean putting both search and category selects into the same
<form>
or performing black magic in JS. Would it be ok with you to derive the categories/index partial into the files/index view?
- If you decide to change Redactor for something else, it keep irrelevant code out of the way.
- Simple all the way. I'd like to avoid 3rd party as much as I can, unless it makes everything significantly easier. I'd rather have 3 lines vs 1 line + ransack
- Filtering on name and category makes sense. Removes current index filtering by categories, and that's good. I'd like to redo category management UI eventually.
Hey guys! Why not something like http://www.datatables.net/. It's fast, has search, sort and paging build in... Also comes via a Gem https://github.com/rweng/jquery-datatables-rails
Anyone still considering implementing this?