Closed Bar2d2 closed 2 years ago
Hi, acts_as_list is great! But lately I was wondering is it possible to use it to sort ActiveStorage Attachments?
In my model I have:
has_many_attached :photos acts_as_list scope: [:photos]
but still getting error NoMethodError - undefined method `insert_at'.
Thank's in advance for any help.
Hi @Bar2d2, in my experience you'd need to create an intermediate model of your own called Photo that has_one_attached :file and acts_as_list scope: :parent_thing_id`. That would allow you to order your photos.
has_one_attached :file
Hi, acts_as_list is great! But lately I was wondering is it possible to use it to sort ActiveStorage Attachments?
In my model I have:
has_many_attached :photos acts_as_list scope: [:photos]
but still getting error NoMethodError - undefined method `insert_at'.
Thank's in advance for any help.