如何为我的模型实现grouped_collection_select使用closure_tree gem?
我有Location模型,它有name和parent_id属性。我想做这样的事情。
<select name="locations">
<optgroup label="Office">
<option value="3">Office Table 1</option>
<option value="4">Office Table 2</option>
</optgroup>
<optgroup label="Lab">
<option value="5">Another Door 1</option>
<option value="6">Another Door 2</option>
<option value="7">Another Door 3</option>
<option value="8">Another Door 4</option>
<option value="11">Another Door 5</option>
</optgroup>
⋮
</select>
&#13;