Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to 'copy and paste' a whole Rails application?

I have a fully-functioning Rails application running on my local machine called 'first-app' in my Rails applications folder 'rails-apps'. I would like to create a second application in rails-apps (called 'second-app') which is identical to first-app, just with a different name.

Can I simply copy-and-paste first-app and rename the folder to 'second-app'? I have found only two files in the whole application which contain the term 'first-app' (application.rb and routes.rb, both in config), so presumably I would have to change their contents as well. If this 'copy-and-paste' approach is viable, are there any other files I would have to alter?

If I have to do the usual > rails new second-app, I must be able to copy and paste a lot of the files and folders from first-app. Which are the ones that I have to manually alter or construct with a rails command?

like image 591
Bazley Avatar asked Jan 14 '11 15:01

Bazley


2 Answers

yes, it should works! Just replace in the copy-project the old terms('first-app') to 'second-app' and create a new database for the new app.

like image 56
bob4ever Avatar answered Oct 21 '22 18:10

bob4ever


You can copy and past the first app folder and use the gem 'rename' to rename the copied app. Follow these instructions: How to rename rails 4 app?

like image 24
Benjamin J. Benoudis Avatar answered Oct 21 '22 17:10

Benjamin J. Benoudis