Comments (6)
Any updates here? I'm facing the exact same challenge.
from rails_admin_nestable.
Hi, do you have any update on this issues, I having exact the same issues
from rails_admin_nestable.
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 scope
should be a viable option for when you want to add a member action to sort it's children.
Something along the lines of Team
-> Players
where:
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 Proc
in order keep it as DRY as possible and nifty packed into objects.
from rails_admin_nestable.
Hi @gotjosh!
I was thinking to refactor the codebase and implement the same member action for a long time, but I never found the time to realize it.
I didn't understand if you want to realize the nestable_member
as a model's class method or as a rails_admin DSL. For instance:
RailsAdmin.model 'Team' do
nestable_member({
scope: :players
})
end
Personally I prefer the DSL approach.
Anyway I would really appreciate a PR with nestable_member
implementation 😃
from rails_admin_nestable.
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 nestable_member
method?
For instance given Team with many Players and many Coaches, we could need the ability to sort the both children models by a single Team record.
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
from rails_admin_nestable.
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.
from rails_admin_nestable.
Related Issues (20)
- "undefined method `options' for nil:NilClass" when using nestable_list HOT 1
- wrong number of arguments (1 for 3) when update HOT 3
- nestable_tree true is required
- Sorting a tree
- How to display associated model's name in sorting menu HOT 2
- Corrupt gemfile
- scope does not work as expected
- Any chance to replace default "list" with a "nestable_tree"? HOT 5
- Add possibility to sort by group HOT 1
- Gradient has outdated direction syntax
- nestable list not nestable HOT 3
- Gets stuck in loop HOT 1
- `render text: msg` is deprecated in Rails 5.1 HOT 1
- NoMethodError in RailsAdmin::Main#nestable HOT 1
- Bundle outdated HOT 1
- jquery.nestable typo
- Render collapsed tree HOT 1
- ActionView::Template::Error on Rails 6 HOT 3
- Compatible with Rails 7.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rails_admin_nestable.