Rename Rails App
Rename your app the simple way.
Used 89 times
B
Ben Latz
Usage
After it renames your app, it will change the directory it lives in. To get back into your Rails app:
cd .. cd YourNewNameHere
Then you can remove the rename gem via
bundle remove rename
Run this command in your Rails app directory in the terminal:
rails app:template LOCATION="https://railsbytes.com/script/Xg8sNz"
Template Source
Review the code before running this template on your machine.
name = ask("Enter new name for your Rails app:")
puts "💎 Adding gem 'rename'"
run "bundle add rename"
rails_command "g rename:into #{name}"
# puts "🧹 Removing gem 'rename'"
# run "bundle remove rename"
Comments
Richard Logwood
Thanks Ben - I've forked this to support Rails 6 via a patched
rename
gem, see Rename Rails App - for Rails v6