3

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.

Sam Mason
  • 1,037
  • 1
  • 8
  • 29
  • 2
    Duplicate of: http://stackoverflow.com/questions/3270373/renaming-ruby-on-rails-application (comment says it works for rails 4). – rlecaro2 Jan 15 '14 at 19:46
  • I'm not sure which answer your referring to. The rails plugin says it doesn't work for rails 4 – Sam Mason Jan 15 '14 at 21:55
  • 2
    possible duplicate of [How to rename rails 4 app?](http://stackoverflow.com/questions/20988813/how-to-rename-rails-4-app) – Hardik Aug 19 '14 at 06:31

3 Answers3

5

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!!

Dudo
  • 4,002
  • 8
  • 32
  • 57
1

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.

Noah Clark
  • 8,101
  • 14
  • 74
  • 116
0

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

Sushant Mane
  • 757
  • 7
  • 14