From looking in the online docs and the Rails book I can only find examples of acts_as_list with parent-child relationships. What if I just have a list with no parent class? Can I use acts_as_list with the position field in this case? Where does the :order statement go? Thanks, Peter
Francois Beausoleil
2005-Nov-01 06:25 UTC
Re: acts_as_list must be with parent-child relationship?
Hello Peter, 2005/11/1, Peter Michaux <petermichaux@shaw.ca>:> From looking in the online docs and the Rails book I can only find > examples of acts_as_list with parent-child relationships. What if I > just have a list with no parent class? Can I use acts_as_list with the > position field in this case? Where does the :order statement go?There are no requirements that the acts_as_list be used in a child category. The order should be added to any finds you do, such as in your controllers, and other places. In fact, you should probably define a new method in your model which returns instances in the right order - DRY (don't repeat yourself). Hope that helps ! -- François Beausoleil http://blog.teksol.info/ _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails