How to rename a rails 5 application?

后端 未结 4 772
执笔经年
执笔经年 2021-01-01 11:10

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?

4条回答
  •  灰色年华
    2021-01-01 11:16

    With the most popular text editors and IDEs you can search for a string across all project files. If by any chance you are using Sublime Text, you can do it with the keyboard shortcut Ctrl++F or using Find > Find in files, as explained here.

    Remember that your app name might appear in the following formats:

    • MyAppName (in application.rb)
    • my-app-name
    • my_app_name
    • My App Name (in layouts)

    In my case, for a Rails 5.1.6 app I had to edit the following files:

    • config/application.rb
    • config/cable.yml
    • config/database.yml (if you want to change database names)
    • config/environments/production.rb
    • app/views/layouts/application.html.erb
    • package.json
    • app/mailers/* (change email from addresses)
    • config/initializers/devise.rb (config.mailer_sender)

提交回复
热议问题