1
我想從另一個模型獲取集合選擇,並且我不斷收到上述錯誤。到處看,得到鐵軌投下,但沒有任何意義。語法錯誤,意外',',期待')'RoR
_form.rb
<%= f.label :city %><br />
<%= f.collection_select (:share ,:city_id, City.all , :id, :name) %>
它強調 '形式' 上的錯誤報告
<h1>New share</h1>
<%= render 'form' %>
<%= link_to 'Back', shares_path %>
這裏是我的模型......
class Share
include Mongoid::Document
field :name, type: String
field :type, type: String
field :summary, type: String
field :description, type: String
field :city, type: String
embedded_in :city
has_many :category
end
class City
include Mongoid::Document
embedded_in :share
field :name, type: String
field :country, type: String
attr_accessible :name, :city_id, :id
end
搜索無處不在,我就想不通出來。它一定是愚蠢的。
我經歷了它,一切似乎正確。似乎沒有任何開放。 – McDoku