2013-12-18 50 views
0

我安裝的祖先創業板成功地追蹤指令從https://github.com/stefankroes/ancestry兩個深度水平填充下拉列表和我的分類表是這樣的: 分類(ID,CATEGORY_NAME,血統,created_at,的updated_at) enter image description hereRails的,祖先的寶石,與

我想要選擇基於父 - >子類別 - >子子類: enter image description here

在這一點上與代碼(從https://github.com/stefankroes/ancestry/wiki/Creating-a-selectbox-for-a-form-using-ancestry採取)我只能設法讓下面這不是CORRE克拉。 enter image description here

+0

我們可以看到一些代碼嗎? – DickieBoy

回答

1

您的數據是錯誤的。爲了模擬這個結構,你應該有正確填充的祖先列。它應該包含根節點(元素的ID)的整個路徑,由'/'分隔。例如手錶應該是5/13,因此它顯示在衣服下(Id:13)