0
我对Rails的多元化和驼峰感到困惑。尤其是我长而清晰的名字。导致类名长的路径错误
我有一个User
模型和一个Account
模型。我也有一个user_to_account_log_history
模型和控制器来保存两者之间的转移。关系是建立的。
我跑......
$ 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
。为什么?我感觉这是一个漫长而漫长的过程,会让整件事情混乱起来。
谢谢!我没有下划线进入路线。 –