別のモデルからコレクションを選択しようとしていますが、上記のエラーが引き続き発生します。どこでも見て、レールキャストを手に入れましたが、何も意味がありません。
_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
あちこち探してもわからない。それはばかげたことに違いない。