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 ?
No, it's not possible at the moment.
Only belongs_to, sorry.
May be I could help you providing this feature.
Is it a client-side problem, a server side one or the both ? Do you have any plan for it or any pointer in sources ?
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. :)