rails3アプリでmongoidをセットアップし、2つのモデルを作成しました。1つのモデルはユーザーであり、もう1つのモデルは記事です。
私は各ユーザーが多くの記事を作成できるので、次のように記述しました。
embedded_in :user
model / article.rbファイル内、および:
embeds_many :articles
model/user.rbファイル内。
ここで、「app_url / articles / random_article_id」で記事にアクセスすると、次のエラーが発生します。
Access to the collection for Article is not allowed since it is an embedded document, please access a collection from the root document.
関係を維持したいのですが、誰でも記事にアクセスできるようにしたいと思っています。どうやってやるの??