Railsの複数形化とキャメルケースで混乱します。特に私の長いが明確な名前で。
User
モデルとモデルがありAccount
ます。またuser_to_account_log_history
、2つの間の転送を保存するためのモデルとコントローラーもあります。関係が設定されています。
私は走った...
$ rails generate controller UserToAccountLogHistories
...これは次を作成しました:
# app/controllers/user_to_account_log_histories_controller.rb
class UserToAccountLogHistoriesController < ApplicationController
# a simple index method
end
# app/models/user_to_account_log_history.rb
class UserToAccountLogHistory < ActiveRecord::Base
end
私のルートは適切に配置されているようです(rake routes
出力、切り捨て):
user_usertoaccountloghistories GET /users/:user_id/usertoaccountloghistories(.:format) {:action=>"index", :controller=>"usertoaccountloghistories"}
しかし、私はを取得していuninitialized constant UsertoaccountloghistoriesController
ます。なんで?物事を台無しにするのは、長い名前のキャメルケースと複数形だと感じます。