2

選択したプラグインの選択メニューは表示されますが、 「少なくとも1つのカテゴリを選択するか、作成する」というプロンプトを表示したい場合でも、「いくつかのオプションを選択」と表示されます。

<%= f.select :category_ids, Category.all.collect {|c| [c.name, c.id]}, {:prompt => "Select at least one category...."}, { :multiple => true, :class => "category-select" } %>

プロンプトはリストにあり、プレースホルダーのように直接表示されている場合ではありません。どうすればこの方法で入手できますか?

アップデート

私が使用するpromptと、実際にドロップダウンに配置され、カテゴリとして選択できるため、その場で間違っています。

4

2 に答える 2

0

代わりに2行getAttribute("data-placeholder")?を変更する必要があるレールのように見えるので、2行を変更するだけです:placeholder

return this.form_field.getAttribute("placeholder")?this.default_text=this.form_field.getAttribute("placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||"Select Some Options":this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||"Select an Option",this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||"No results match"
于 2012-07-27T23:59:31.757 に答える