Sam Mason
Sam Mason

Reputation: 1037

Renaming a Rails 4 app

I have created a Rails 4 app but the name has since changed.

I have updated the folder name, but I was wondering what files do I need to go into and update to have this new name throughout the site, or if there is rails command that will do this quickly and easily.

Upvotes: 3

Views: 2331

Answers (3)

Sushant Mane
Sushant Mane

Reputation: 777

Add gem 'rename' to Gemfile then do bundle install .

After bundle install
rails g rename:app_to name_of_app

And if you are using mongoid then you need to rename the database name in config/mongoid.yml

Upvotes: 0

Dudo
Dudo

Reputation: 4169

https://github.com/morshedalam/rename - I posted an issue there for you. It was great for me with rails 3.

survey says... it works great with Rails 4!!

Upvotes: 5

Noah Clark
Noah Clark

Reputation: 8131

You should search the directory for all instances of the app name:

ack "app-name" and figure out what each one is doing. You will often times have named spaced modules under the old name.

config.ru and config/application.rb for sure should be checked.

Upvotes: 1

Related Questions