I think you need to add a category to the set instead of the string.
Presumably you''ve got something like
class Category < ActiveRecord::Base
acts_as_nested_set
...
end
When you''re adding a string, it doesn''t know how to
act_as_nested_set.
Instead, when you add_child you should add a child of class category.
On 9/5/05, Bryan M <millsb93-MM5q5SmrhtOVc3sceRu5cw@public.gmane.org>
wrote:>
> I''m having some trouble getting nested sets to work. The read
methods work
> fine:
>
> #works no prob
> @root = category.find(1)
> @list = @root.full_set
>
> but whenever I try to use add_child(), I get an error:
>
> @root.add_child("camera")
>
> Error:
> undefined method `reload'' for "camera":String
>
> Obviously, my string isn''t an object...but I''m not sure
why it thinks it
> should
> be. Am I just using this wrong?
>
> Thanks,
> Bryan M
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails