-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select field in search form #60
Comments
I had the same issue and that's where the newest PRs came from (#59 & annkissam/rummage_ecto#66) They work (I'm using them in production code), but they need to be documented. Basically, it gets rid of the search_form and you can use your own. I think @aditya7iyengar would like to document it better before officially releasing it, so I'd say you don't need to work on implementing this, but it might be tricky to use. In short, if gives the sort and search fields a name, which gets used in the view. It translates those name into a query in a rummage module you'll create for each schema that you want to rummage. That makes the views much simpler, and you can then use your own search form. I'll try to describe it briefly: in mix.exs
in your index:
in your_controller:
For all the rummage schema's there's an example here: https://github.com/aditya7iyengar/rummage_ecto/pull/66/files#diff-b99205d171d4be5eb3ae3715078ec7cb |
Thanks a lot @ericsullivan ! Your hints were a great starting point. I got it to work now but it was a bit tricky as you mentioned. Maybe it is helpful that I point out what tripped me up for testing or if anyone else is trying this:
So a bit hacky but it works for now. I will follow the development of the new api and contribute when I can. |
Hi,
I would like to have a select field in the search form with some predefined options. I have been looking into the implementation of search_form but it does not seem to be possible at the moment. Unless I am missing something?
If it is possible (maybe through a workaround) I would be helpful for any pointers on how to achieve this and may add some documentation for it when I get it to work.
If it is not possible I would possibly work on implementing this. Would you be interested in merging such a PR? It would be interesting to get a hint on how you would like this to be implemented in that case.
Thanks!
The text was updated successfully, but these errors were encountered: