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
Hi. How can I reorder or sort the associated collection scope ?
I tried
field :some_fields do orderable true associated_collection_scope do Proc.new do |scope| scope = scope.reorder('some_table_names.some_table_column ASC') end end end
But it doesn't work for me. Any ideas ? Thanks.
The text was updated successfully, but these errors were encountered:
I'm also looking for a nice solution to this problem. Right now I've resorted to a default_scope { order :field }.
default_scope { order :field }
Sorry, something went wrong.
One thing you can do is scope the list action of the model.
For instance, in my case, I had a model called Post which belongs_to Venue. The solution for me was to sort the list by name:
config.model 'Venue' do list do sort_by :name end end
Why do not use associated_collection_scope for order?
No branches or pull requests
Hi.
How can I reorder or sort the associated collection scope ?
I tried
But it doesn't work for me. Any ideas ?
Thanks.
The text was updated successfully, but these errors were encountered: