Forum: Ruby on Rails acts_as_list with :scope - how do I move items to a differen

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
A36864cb890189384d36f627f6c05d9c?d=identicon&s=25 Dmitry Yakovkin (Guest)
on 2007-04-29 22:55
(Received via mailing list)
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?

Db7238007950074e9e73b76a81910406?d=identicon&s=25 tonypm (Guest)
on 2007-05-01 08:09
(Received via mailing list)
This worked for me.

@album =[:pic])

but there may be a better way.

This topic is locked and can not be replied to.