# Same file in different apps

**URL:** <https://www.ruby-forum.com/t/same-file-in-different-apps/195524>\
**Category:** Rails\
**Created:** [September 24, 2010, 11:18am UTC](https://www.ruby-forum.com/t/same-file-in-different-apps/195524 "2010-09-24T11:18:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [September 24, 2010, 11:18am UTC](https://www.ruby-forum.com/t/same-file-in-different-apps/195524/1 "2010-09-24T11:18:18Z")

</div>

Hello G.s,

Is there any way to use same file(model/controllers/views) between two  
different applications. If possible then how… ?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [September 24, 2010, 11:24am UTC](https://www.ruby-forum.com/t/same-file-in-different-apps/195524/2 "2010-09-24T11:24:44Z")

</div>

On Sep 24, 10:18 am, Hemant B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello G.s,
> 
> Is there any way to use same file(model/controllers/views) between two  
> different applications. If possible then how… ?

You can stick them in a plugin these days (rails 3 also has some  
mountable apps stuff)

Fred

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [September 24, 2010, 11:27am UTC](https://www.ruby-forum.com/t/same-file-in-different-apps/195524/3 "2010-09-24T11:27:21Z")

</div>

Frederick C. wrote:

> You can stick them in a plugin these days (rails 3 also has some  
> mountable apps stuff)
> 
> Fred

What plugings ? I am using rails 2.3.2… Can you light me something… 🙂

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [September 24, 2010, 12:15pm UTC](https://www.ruby-forum.com/t/same-file-in-different-apps/195524/4 "2010-09-24T12:15:05Z")

</div>

On Sep 24, 10:27 am, Hemant B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Frederick C. wrote:
> 
> > You can stick them in a plugin these days (rails 3 also has some  
> > mountable apps stuff)
> 
> > Fred
> 
> What plugings ? I am using rails 2.3.2… Can you light me something… 🙂

Your own plugin - you write one containing the code you want to share.

Fred

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [October 5, 2010, 11:47am UTC](https://www.ruby-forum.com/t/same-file-in-different-apps/195524/5 "2010-10-05T11:47:43Z")

</div>

If i’ll write an class/module and then share that class/module using  
require/whatever… Will that work?

Frederick C. wrote:

> Your own plugin - you write one containing the code you want to share.
> 
> Fred

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [March 3, 2011, 2:50pm UTC](https://www.ruby-forum.com/t/same-file-in-different-apps/195524/6 "2011-03-03T14:50:34Z")

</div>

Well say if i need app/models/abc.rb of an existing application ABC into  
new application DEF, then what all i need to do? There are so many files  
i need to be shared but did’nt have any fair idea how to get it.

So rubians :), please help me on it.

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [October 5, 2010, 2:30pm UTC](https://www.ruby-forum.com/t/same-file-in-different-apps/195524/7 "2010-10-05T14:30:25Z")

</div>

Hemant B. wrote:

> If i’ll write an class/module and then share that class/module using  
> require/whatever… Will that work?
> 
> Frederick C. wrote:
> 
> > Your own plugin - you write one containing the code you want to share.
> > 
> > Fred

Fred’s suggestion is the correct way. Just write a plugin/gem.

Best,  
–Â  
Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

Sent from my iPhone
