エンジンを別のアプリで使用してインストール ジェネレーターをテストしようとしていますが、失敗しているようです。インストール ジェネレーターを長い間使用していないため、いつ壊れたのか (または本当にスムーズに機能したのか) がわかりません。私のプロジェクトはレーダー/前線に基づいているので、彼らのコード (ジェネレーターを含む) をたくさん借りようとしました。
編集: 私のインストーラーはエンジン テスト/ダミーでは機能しますが、他のアプリでは機能しません。なんで?
GH の問題: https://github.com/NJayDevelopment/mongoid_forums/issues/16
ログは次のとおりです。
$ rails g mongoid_forums:install
What is your user class called? [User]
What is the current_user helper called in your app? [current_user]
Defining mongoid_forums_user method inside ApplicationController...
insert app/controllers/application_controller.rb
Adding mongoid_forums initializer (config/initializers/mongoid_forums.rb)...
create config/initializers/mongoid_forums.rb
(erb):5:in `template': undefined method `per_page' for MongoidForums:Module (NoMethodError)
The route is successfully added, however the initializer/mongoid_forums.rb is a blank file. The method is defined exactly how radar/forem does it, what could be the error?
関連するコードは次のとおりです。
ページごとのメソッド定義: https://github.com/NJayDevelopment/mongoid_forums/blob/master/lib/mongoid_forums.rb#L33
Mattr アクセサー: https://github.com/NJayDevelopment/mongoid_forums/blob/master/lib/mongoid_forums.rb#L9
エラーポイントにジェネレーターをインストールします: https://github.com/NJayDevelopment/mongoid_forums/blob/master/lib/generators/mongoid_forums/install_generator.rb#L47