3

Railsヘルパーで次のようなスクリプトを使用したい:

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

しかし、私のスクリプトでは何も起こりません。include_blank メソッドで option_groups_from_collection_for_select を使用するにはどうすればよいですか?

4

1 に答える 1

2

include_blankはselectヘルパーのオプションなので、ほとんどそこにいました。

select_tag(:article_id, option_groups_from_collection_for_select( @article, :categories, :name, :id, :name), {:include_blank => "Select one category"})
于 2010-07-04T01:57:29.470 に答える