我的模型类:嵌套路由on Rails的
class Category < ActiveRecord::Base
acts_as_nested_set
has_many :children, :foreign_key => "parent_id", :class_name => 'Category'
belongs_to :parent, :foreign_key => "parent_id", :class_name => 'Category'
def to_param
slug
end
end
是否有可能有这样那样的递归路线: /root_category_slug/child_category_slug/child_of_a_child_category_slug
...等一个
感谢您的帮助: )
伟大的问题。 – 2010-04-04 02:30:40