假设我有模型 CourseGroup。 Controller 的名称是什么?
最佳答案
Controller 名称将是 course_groups_controller
。
http://itsignals.cascadia.com.au/?p=7
要查找任何模型的名称,您可以打开 Rails 控制台并执行 "ModelName".tableize
。然后只需在末尾添加“_controller”。这将导致 model_names_controller
。
关于ruby-on-rails - rails : What is the convention for controllers with many words,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4570885/