MongoMapperを使用してRails 3エンジンを作成しようとしています。私は痛みの世界を持っています。MongoMapperを使用してRailsエンジンを作成する
module GoodComments
class Comment
include MongoMapper::Document
key :comment, String
end
end
スーパーシンプルな、私は知っている:ここに私のモデルです!マイのconfig/routes.rbを:私はrails generate scaffold_controller Comment -o mongo_mapper
を走ったし、私のコントローラが生成された
require File.expand_path('../boot', __FILE__)
module GoodComments
class Application < Rails::Application
config.generators do |g|
g.orm :mongo_mapper # :active_record
g.template_engine :erb # :haml
g.test_framework :rspec, :fixture => true, :views => false
g.fixture_replacement :factory_girl, :dir => "spec/factories"
end
end
end
:
GoodComments::Engine.routes.draw do
resources :comments
end
私はのconfig/application.rbを作成しました。私は自分のサーバーを実行し、http://localhost:3000/good_comments/comments
に行くとき、私はエラーを取得する:GoodCommentsで
とLoadError :: CommentsControllerの#インデックスを定義する
期待/Users/shamoon/Sites/good_comments/app/models/comment.rbコメント Rails.root:/ Users/shamoon/Sites/good_comments/test/dummy
ヘルプがありますか?
を私は 'を取り除く場合オーケー..それは一種の作品モデル内のGoodComments'名前空間。しかし、足場 'new'はモデル定義のフィールドを読みません。 – Shamoon