开发者

Hide a Collection_Select Option

I have dropdown built by option_groups_from_collection_for_select(Category.all, :subcategories, :name, :id, :name). How ca开发者_如何转开发n I hide one of the categories that appears?


Instead of Category.all, you can pass in

Category.where("id NOT IN (?)", [1, 2, 3])

That will exclude categories with ids 1, 2 and 3.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜