We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'd like to sort child categories within their parents. I use the ancestry gem for generating categories.
Would ranked-model play well with it? If so, how would I go about setting the scope for sorting within parent categories?
Also, do you tell it which position to use if you were to move a category from say.. the bottom of the list to the middle somewhere?
The text was updated successfully, but these errors were encountered:
It looks like you can just do the following:
ranks :row_order, with_same: [:ancestry]
I've included an array there because you may want to add other constraints such as a belongs_to association.
belongs_to
However, I'm currently having trouble using the :up and :down values for reordering! :) But the scoping seems to work properly at least :)
:up
:down
Sorry, something went wrong.
Great, thank you.
No branches or pull requests
I'd like to sort child categories within their parents. I use the ancestry gem for generating categories.
Would ranked-model play well with it? If so, how would I go about setting the scope for sorting within parent categories?
Also, do you tell it which position to use if you were to move a category from say.. the bottom of the list to the middle somewhere?
The text was updated successfully, but these errors were encountered: