-
Notifications
You must be signed in to change notification settings - Fork 71
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
Possibility to sort children of a parent (Has many association) #54
Comments
I have managed to figure out a way this could work. I believe that by adding an additional action that attaches itself to a member and specifying the Something along the lines of class Team < ActiveRecord::Base
nestable_member({
scope: :players
})
end This would add a member action on each team that allows players to be sorted. Please let me know if this is a functionality you would like to have inside the gem. I believe the most effort should be applied in extracting the re-usable parts of the controller |
Hi @gotjosh! I didn't understand if you want to realize the RailsAdmin.model 'Team' do
nestable_member({
scope: :players
})
end Personally I prefer the DSL approach. Anyway I would really appreciate a PR with |
Moreover I was thinking that we could need to sort different kind of children by a single parent... What do you think about to receive a nested set of hash in the So we could approach that with a something like this: RailsAdmin.model 'Team' do
nestable_member :players, coaches: {
position_field: :ranking,
live_update: true
}
end Let me know what do you think |
Fantastic! I'll be working with @gotjosh on (by Friday) this one since we're pairing for the implementation of the client work that needed this. We already have it up and running in our codebase, we would just need to extract it and open up the PR. Feel free to assign it to me. |
Any updates here? I'm facing the exact same challenge. |
Hi, do you have any update on this issues, I having exact the same issues |
While taking a look at the source code and/or documentation it is unclear on how we could achieve the sortability of children of a parent class (something along of the lines of sorting Players for a given Team).
I would love to have that for a current project I am working on and if you could point me in the right direction I would gladly open up a PR.
My initial analysis takes me on the route to convert (or extend) the Sortable action to be able to use it within an
association
field which uses a different kind of configuration. If this is something we want included here I would more than gladly submit more information regarding my investigation.The text was updated successfully, but these errors were encountered: