Closed nahankid closed 8 years ago
Would you provide a back trace when the error occurs? That helps focus my effort when searching for the issue.
Hi Charles,
Thanks for getting back to me and Thanks for active_admin-sortable_tree. It’s a great gem.
I’ve asked this question on http://stackoverflow.com/questions/28786234/undefined-method-sort-option-for-ancestrysymbol, with offending code snippet and partial stack trace.
Thanks for your help
From: Charles Maresh [mailto:notifications@github.com] Sent: 01 March 2015 22:13 To: zorab47/activeadmin-sortable-tree Cc: nahankid Subject: Re: [activeadmin-sortable-tree] undefined method `sort_option' for :ancestry:Symbol (#45)
Would you provide a back trace when the error occurs? That helps focus my effort when searching for the issue.
— Reply to this email directly or view it on GitHub https://github.com/zorab47/activeadmin-sortable-tree/issues/45#issuecomment-76609899 . https://github.com/notifications/beacon/AFeVq3n8r5jt9U3GUWYkssFtXLJIaNKNks5nwzkWgaJpZM4DnfrE.gif
My best guess is to provide the sort direction as modetojoy mentioned in your StackOverflow post: undefined method 'sort_option' for :ancestry:Symbol
Try setting the sort direction directly by providing a hash to :sorting_attribute
:
sortable tree: true, sorting_attribute: { :ancestry => :asc }, collapsible: true, start_collapsed: true
Thanks. Tried that in vain
{:ancestry=>:asc} is not a symbol
From: Charles Maresh [mailto:notifications@github.com] Sent: 03 March 2015 09:22 To: zorab47/activeadmin-sortable-tree Cc: nahankid Subject: Re: [activeadmin-sortable-tree] undefined method `sort_option' for :ancestry:Symbol (#45)
My best guess is to provide the sort direction as modetojoy http://stackoverflow.com/users/1609937/modetojoy mentioned in your StackOverflow post: undefined method ' http://stackoverflow.com/questions/28786234/undefined-method-sort-option-for-ancestrysymbol sort_option' for :ancestry:Symbol
Try setting the sort direction directly by providing a hash to :sorting_attribute:
sortable tree: true, sorting_attribute: { :ancestry => :asc }, collapsible: true, start_collapsed: true
— Reply to this email directly or view it on GitHub https://github.com/zorab47/activeadmin-sortable-tree/issues/45#issuecomment-76882519 . https://github.com/notifications/beacon/AFeVq-FHP1f_fY4LETvUcWji3jFOKVtbks5nxSdJgaJpZM4DnfrE.gif
If you have any additional updates, please reopen this issue! Thanks.
When trying to view a tree in ActiveAdmin, this is throwing error: _undefined method `sortoption' for :ancestry:Symbol
This doesn't work with the combination: Mongoid, mongoid-ancestry and active_admin-sortable_tree But works fine with ActiveRecord, Ancestry and active_admin-sortable_tree
Sample source code is at: https://github.com/nahankid/community