-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Is it possible to add filter on an HABTM associated model's field ? #1342
Comments
No, it's not possible at the moment. |
Ok, thanks. May be I could help you providing this feature. Regards. |
Could you try this hack : https://github.com/Val/rails_admin/commit/6cc8ac5d3f8ea0bf1eae1145f27851fccc50911b It's working for me but I'm not sure to follow your code style... Hope it helps. |
Note: lines 42-44 of ra.filter-box.js were ended with a non-printable space character and I did remove them, that's why they appear on diff. |
@bbenezech : Did you take a look at the diff (https://github.com/Val/rails_admin/commit/6cc8ac5d3f8ea0bf1eae1145f27851fccc50911b) ? |
Your work looks nice, but some more jobs still need to be done.
How's your opinion on them? |
@mshibuya : Thanks for taking time to review the patch. I agree with you, it needs tests and lacks some kind of configuration option and perhaps a better rails_admin DSL inclusion too. I'll try to refactor my code. |
I need same functionality for has_many :thorugh association may be it is possible to implement it too ? and i did not find any filter code for simple has_many association (without through) , I can try to implement it I think you code can help me. :) |
I'm trying to override list view pretty_value on associated model to provide a quick link to associated model's list using filter to show only associated records.
It works well for has_many associations but not for HABTM ones.
To see it try this gist : https://gist.github.com/3810559
Author 1-N Book works
Book N-N Collection doesn't : if you try to add a book filter in collection list or a collection filter in book list there is no selector option ("contains", "is exactly", etc.)
Any tips or documentation pointer ?
Regards.
The text was updated successfully, but these errors were encountered: