# Linking Rails Applications

**URL:** <https://www.ruby-forum.com/t/linking-rails-applications/88564>\
**Category:** Rails\
**Created:** [March 12, 2007, 6:18pm UTC](https://www.ruby-forum.com/t/linking-rails-applications/88564 "2007-03-12T18:18:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lewis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e9bcb4/32.png) [@Lewis](https://www.ruby-forum.com/u/Lewis)\
**Post date:** [March 12, 2007, 6:18pm UTC](https://www.ruby-forum.com/t/linking-rails-applications/88564/1 "2007-03-12T18:18:11Z")

</div>

I have created two rather simple ROR applications. I would like to  
link them together but they are in different sub directories and use  
different databases. I created App1 and it is in use. I have since  
created app2, which triggers two small db searches. I would like to  
have app2 link to app1 without having to copy app2 into the same  
directory as app1.

They exists in C:\ruby\bin\app1 and C:\ruby\bin\app2.

I tried: \<%= link\_to 'Building Permits ',  
:controller =\> ‘item’,  
:action =\> ‘list’ %\>  
 this is from within app2\admin\main

I get the following error: no route found to match “/item/list” with  
{:method=\>:get}

I am new at this and learning as I go along, any help would be greatly  
appreciated.

Lewis

---

<div class="post-metadata">

**Author:** ![Lewis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e9bcb4/32.png) [@Lewis](https://www.ruby-forum.com/u/Lewis)\
**Post date:** [March 12, 2007, 6:31pm UTC](https://www.ruby-forum.com/t/linking-rails-applications/88564/2 "2007-03-12T18:31:14Z")

</div>

You can use link\_to to create links just with the actual URL: so, say  
you’re  
running this on localhost.

link\_to ‘Building Permits’, ‘[http://localhost:3000/app1/item/list](http://localhost:3000/app1/item/list)’  
You can put whatever you want in that second string and it should create  
a  
link to it.

It is also possible, through using the establish\_connection, to have the  
second app just access the first app’s DB, if that would work better for  
you. See  
[http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001075](http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001075)
