0

我正在使用以下代码来获取默认值

<%= f.collection_select :location_id, Location.all, :id, {:selected => session["location"]},:formatted_display, { prompt: true }, :required => true,  :class => 'chosen-select order_form' %>

尝试上述操作时出现以下错误:

wrong number of arguments (7 for 4..6)
4

1 回答 1

1

试试这个

<%= f.collection_select :location_id, Location.all, :id, :name,{ :prompt => true , :selected => session["location"]},  :class => 'chosen-select order_form'%>
于 2013-10-22T14:57:02.037 回答