开发者

Can I use option_groups_from_collection_for_select with include_blank on rails?

I want use on my rails helper a script as follow:

select_tag(:article_id, option_groups_from_collection_for_select( @article, :categories, :name, :id, :name, :include_blank => "Select one category"))

but in my script, nothing happens. How can I use option_groups_from_colletion_for_select with include开发者_JAVA百科_blank method?


include_blank is an option for the select helper, so you were almost there:

select_tag(:article_id, option_groups_from_collection_for_select( @article, :categories, :name, :id, :name), {:include_blank => "Select one category"})
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜