如何重命名 rails 5 应用程序? [英] How to rename a rails 5 application?

查看:37
本文介绍了如何重命名 rails 5 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

rename gem 是重命名 Rails 5 应用程序的最佳方式吗?

Is the rename gem the best way to rename my rails 5 app?

另外,在重命名我的应用程序时有什么注意事项吗?

Also, is there any notes I have to keep in mind when renaming my app?

推荐答案

重命名 Rails 5 应用程序更容易!

Renaming your rails 5 app is even easier!

打开 Rails 项目中的 config/application.rb 文件,您会看到一个与您的应用同名的模块.您需要做的就是将模块名称更改为您首选的应用名称.

Open up the config/application.rb file within your rails project, there you see a module with the same name as your app. All you need to do is change the modules name to your preferred app name.

除此之外,还有一些其他对旧应用名称的引用,但不需要更改它们.例如,查看 config/initializers/session_store.rb,其中会话 cookie 名称仍然使用旧的应用程序名称.但是 IDE/编辑器中古老的查找全部"功能可能可以帮助您处理这些参考资料.

Besides that there are some other references to the old app name, but changing them is not required. Check out config/initializers/session_store.rb for example, where the session cookies name still uses the old app name. But the good old 'Find all' function in your IDE/editor can probably help you with these references.

这篇关于如何重命名 rails 5 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆