I Have elastic search application up and running in ruby on rails. Actual its on in the root path of the sever. Is it possible to move it to a subdirectory? What is necessary req. for it? what procedure i need to follow
Asked
Active
Viewed 93 times
0
-
1What do you mean by a "root server"? Do you mean moving the app between subdirectories (as opposed to keeping in the `root` path?) – Richard Peck Feb 21 '14 at 09:17
-
@RichPeck yes exactly – Anish Feb 21 '14 at 09:30
-
Okay let me edit your question to make it clearer – Richard Peck Feb 21 '14 at 09:31
-
oh that would be a great!! – Anish Feb 21 '14 at 09:31
-
@RichPeck do you have any suggestion regarding this – Anish Feb 21 '14 at 09:34
-
Yep let me write it out for you – Richard Peck Feb 21 '14 at 09:35
1 Answers
0
Although I've never done this specifically, I believe it's very simple to do:
Routes
Your Rails app's routes are all relative, meaning they don't depend on having "domain.com" as the root path:
#config/routes.rb
root to: "controller#action"
The beauty of Rails is that since all your requests are handled through the ActionDispatch::Routing middleware, you'd basically need to ensure the routes work in order to get the whole application working
Moving
This means that if you're able to deploy your application successfully into a directory, you should be able to get it running regardless of where it is
I would do this:
- New Git Repo in subdir
- Change
database.yml
if db server is different- Redeploy app to new Git
- Test to see if it works (load on new directory)

Community
- 1
- 1

Richard Peck
- 76,116
- 9
- 93
- 147