views:

13

answers:

1

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?

+1  A: 

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"})
Geoff Lanotte