我目前正在运行相同的环境和 rails,但我的输出不同,并且工作正常。我建议重新创建您的分类,然后在产品上重新分配您的分类。“views/shared”中的_taxonomies.html.erb视图可能有问题。
这是我的示例输出(顶层有 4 个分类单元,一个分类单元的第二级有 8 个分类单元):
Started GET "/t/cards/congratulations" for 127.0.0.1 at 2011-12-18 22:11:26 -0500
Property Load (0.1ms) SELECT "properties".* FROM "properties" WHERE "properties"."name" = 'brand' LIMIT 1
Processing by TaxonsController#show as HTML
Parameters: {"id"=>"cards/congratulations"}
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
Taxon Load (0.4ms) SELECT "taxons".* FROM "taxons" WHERE "taxons"."permalink" = 'cards/congratulations' LIMIT 1
Taxon Load (0.3ms) SELECT "taxons".* FROM "taxons" WHERE "taxons"."id" = ? LIMIT 1 [["id", 8]]
Taxon Load (0.3ms) SELECT "taxons".* FROM "taxons" WHERE ("taxons"."lft" >= 8 AND "taxons"."rgt" <= 9) ORDER BY "taxons"."lft"
Taxonomy Load (0.2ms) SELECT "taxonomies".* FROM "taxonomies" INNER JOIN "taxons" ON "taxons"."taxonomy_id" = "taxonomies"."id" AND "taxons"."parent_id" IS NULL
Taxon Load (0.3ms) SELECT "taxons".* FROM "taxons" WHERE "taxons"."taxonomy_id" IN (1, 2, 3, 4) AND ("taxons"."parent_id" IS NULL)
Taxon Load (0.4ms) SELECT "taxons".* FROM "taxons" WHERE "taxons"."parent_id" IN (1, 2, 3, 4) ORDER BY "lft"
Taxon Load (0.4ms) SELECT "taxons".* FROM "taxons" WHERE ("taxons"."lft" <= 8 AND "taxons"."rgt" >= 9) ORDER BY "taxons"."lft"
CACHE (0.0ms) SELECT "taxons".* FROM "taxons" WHERE ("taxons"."lft" <= 8 AND "taxons"."rgt" >= 9) ORDER BY "taxons"."lft"
CACHE (0.0ms) SELECT "taxons".* FROM "taxons" WHERE ("taxons"."lft" <= 8 AND "taxons"."rgt" >= 9) ORDER BY "taxons"."lft"
CACHE (0.0ms) SELECT "taxons".* FROM "taxons" WHERE ("taxons"."lft" <= 8 AND "taxons"."rgt" >= 9) ORDER BY "taxons"."lft"
CACHE (0.0ms) SELECT "taxons".* FROM "taxons" WHERE ("taxons"."lft" <= 8 AND "taxons"."rgt" >= 9) ORDER BY "taxons"."lft"
CACHE (0.0ms) SELECT "taxons".* FROM "taxons" WHERE ("taxons"."lft" <= 8 AND "taxons"."rgt" >= 9) ORDER BY "taxons"."lft"
CACHE (0.0ms) SELECT "taxons".* FROM "taxons" WHERE ("taxons"."lft" <= 8 AND "taxons"."rgt" >= 9) ORDER BY "taxons"."lft"
CACHE (0.0ms) SELECT "taxons".* FROM "taxons" WHERE ("taxons"."lft" <= 8 AND "taxons"."rgt" >= 9) ORDER BY "taxons"."lft"
CACHE (0.0ms) SELECT "taxons".* FROM "taxons" WHERE ("taxons"."lft" <= 8 AND "taxons"."rgt" >= 9) ORDER BY "taxons"."lft"
Rendered spree_dodatest_theme/app/views/shared/_taxonomies.html.erb (140.1ms)
...(继续)