rails 中模型的组合名称 [英] composed name of models in rails
问题描述
我正在使用带有西班牙语的旧数据库的 RoR.我有表格和 registropersona
和模型 RegistroPersona
.现在我想运行 rails generate scaffold_controller registro_persona
但是生成的控制器名称应该是RegistrosPersonasController
(注意 Registros 和 Personas 中最后的 s).我该怎么做?
你可以编辑你的 config/initializers/infletions.rb
文件来支持它,或者只是手动重命名控制器.>
I'm working with RoR with a legacy database in spanish language.
I have the table and registropersona
and model RegistroPersona
. Now I want to run rails generate scaffold_controller registro_persona
But the generated name of controller should be
RegistrosPersonasController
(Note the final s in Registros and Personas).
How can I do this?
You can either edit your config/initializers/infletions.rb
file to support that, or just rename the controller manually.
这篇关于rails 中模型的组合名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!