简体   繁体   中英

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_blank method?

include_blank是select helper的一个选项,所以你几乎就在那里:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM