我正在尝试创建一个表单,其中一个问题是选择一种特定的语言。我正在尝试在这里使用语言列表宝石:https ://github.com/scsmith/language_list 。但是,文档并没有真正向我展示如何将列表与 select_tag 结合起来。
<%= form_for users_path, :method => "get" do %>
<%= label_tag "Select Country" %> <br>
<%= country_select(:user, :country, [], :include_blank => true) %> <br>
<%= label_tag "Language spoken" %>
<%= select_tag "Language", options_from_collection_for_select(LanguageList::COMMON_LANGUAGES, "id", "name") %>
<%= label_tag "City" %> <br>
<%= text_field_tag(:city) %>
<% end %>
给我错误
undefined method 'id' for afr (af) - Afrikaans:LanguageList::LanguageInfo
在线上
<%= select_tag "Language", options_from_collection_for_select(LanguageList::COMMON_LANGUAGES, "id", "name") %>
谁能帮我?