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"})
精彩评论