2016-06-02 13 views

答えて

0

は、ドキュメントによるとselect tag docsあなたはオプションはので、これはそれを行う必要があるハッシュとしてそれを渡す必要があります。

<%= select_tag(:ptype, options_for_select(TourParticipation::PTYPES, selected: "traveler", disabled: "Role:"), {:class => "widens"}) %> 
0

あなたは、次のようにこれを行うことができます:

<%= select_tag :ptype, options_for_select(TourParticipation::PTYPES, selected: "traveler", disabled: "Role:"), {class: "widens", multiple: false, id: ""} %> 

これは、これを使用しapi docsです参照することができます。

1

間違った場所に閉じ括弧があります。 オプションをselect_tagに渡す必要があります(options_for_selectではなく)。だからこれは欲しい:

<%= select_tag(:ptype, options_for_select(TourParticipation::PTYPES, selected: "traveler", disabled: "Role:"), :class => "widens") %> 
関連する問題