# Embed a Rails app within another?

**URL:** <https://www.ruby-forum.com/t/embed-a-rails-app-within-another/64153>\
**Category:** Rails\
**Created:** [June 22, 2006, 4:03pm UTC](https://www.ruby-forum.com/t/embed-a-rails-app-within-another/64153 "2006-06-22T16:03:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradeck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7cd45c/32.png) [@bradeck](https://www.ruby-forum.com/u/bradeck)\
**Post date:** [June 22, 2006, 4:03pm UTC](https://www.ruby-forum.com/t/embed-a-rails-app-within-another/64153/1 "2006-06-22T16:03:00Z")

</div>

I’m looking for a solution where I could load and render pages from one  
Rails application within another. I’m looking through the Rails code  
right now to see if this would even be remotely possible. Does anyone  
have any ideas?

I know the obvious answer would be to proxy the app via Net::HTTP, but  
this is undesirable because:

- I don’t always want to depend on having the “sub” app live on an HTTP  
port (even if firewalled, I would have the overhead of keeping 2 apps  
up).
- I want as few external dependencies as possible.

It would also be nice if the “sub” app required as few modifications as  
possible, to allow drop-in of existing applications.

I’ve got the metaprogramming bug now that I’ve been reading Camping. I  
can’t help but think there would be a simple way to partition off the  
“sub” application, but I have no ideas.

Brad

---

<div class="post-metadata">

**Author:** ![bradeck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7cd45c/32.png) [@bradeck](https://www.ruby-forum.com/u/bradeck)\
**Post date:** [June 22, 2006, 6:29pm UTC](https://www.ruby-forum.com/t/embed-a-rails-app-within-another/64153/2 "2006-06-22T18:29:36Z")

</div>

On 6/22/06, Brad E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m looking for a solution where I could load and render pages from one  
> Rails application within another. I’m looking through the Rails code  
> right now to see if this would even be remotely possible. Does anyone  
> have any ideas?

you could render\_component and have that grab the info from the other  
app via web services.

---

<div class="post-metadata">

**Author:** ![bradeck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7cd45c/32.png) [@bradeck](https://www.ruby-forum.com/u/bradeck)\
**Post date:** [June 22, 2006, 6:58pm UTC](https://www.ruby-forum.com/t/embed-a-rails-app-within-another/64153/3 "2006-06-22T18:58:29Z")

</div>

kate rhodes wrote:

> On 6/22/06, Brad E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I’m looking for a solution where I could load and render pages from one  
> > Rails application within another. I’m looking through the Rails code  
> > right now to see if this would even be remotely possible. Does anyone  
> > have any ideas?
> 
> you could render\_component and have that grab the info from the other  
> app via web services.

Yeah, I was thinking about that. I think I might just write a few  
plugins to proxy loading of Rails apps (through Dispatcher) over DRb.
