Acts_as_list with :scope - how do I move items to a differen

I have in my simplistic app:

class Album
has_many :pics, :order => :position

class Pic
belongs_to :album
acts_as_list :scope => ::album

It all works fine when creating a new pic from the forms. But, when
trying to move a pic between albums, the album changes Ok, but no
matter what I do the position attribute stays the same and the list
navigation is broken. So far, I’ve tried “ << @pic”,
@pic.album = newalbum”, “ @pic”.

What am I doing wrong?


This worked for me.

@album =[:pic])

but there may be a better way.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs