1

I have a rails app, but a client wants to have another rails app be hosted in a ssub-folder of the first rails app.

I can't find any help on how to do this or if it's possible, because if I go to:

http://example.com/second_app, the first app will try and route it despite another app being situated in the second_app folder.

I hope this makes sense, and someone will be able to help.

Stefan Dunn
  • 5,363
  • 7
  • 48
  • 84
  • Can you tell us why you want a second app within the first app? Seems like a pretty odd requirement, there may be a more obvious way to do what you're trying to do. Does he just want a certain URL to point to a different application? – Matt Sep 11 '14 at 10:58
  • Yeh, so he wants a microsite to be http://example.com/microsite (For example) and the main website http://example.com. Each being seperate rails apps. – Stefan Dunn Sep 11 '14 at 11:04
  • 2
    Then you can host it on two different domains and point them to each other . – Caffeine Coder Sep 11 '14 at 12:10
  • How can one achieve this? – Stefan Dunn Sep 11 '14 at 12:23
  • You can configure the routes individually for both the applications – Caffeine Coder Sep 11 '14 at 13:09
  • Read more on it here - http://stackoverflow.com/questions/14693542/show-one-application-on-2-site-with-different-front-ends-but-same-back-end-in-r – Caffeine Coder Sep 11 '14 at 13:11

1 Answers1

1

Sorry, two Rails apps with one inside the other is not possible.

If all you want is a special page for the client, you need a view, controller, and route:

$ rails g controller Pages second_page

And then change your route (config/routes.rb) from get 'pages/second_page’ to get '/second_page’.

After starting up your rails s, you can then go to localhost:3000/second_page and see your page.

If I’m completely misunderstanding what you’re trying to do, please describe your situation a bit more and I’d be happy to help.

lachlanjc
  • 148
  • 1
  • 5