2

I have a 2 different rails project, and I want to share my models among them. How could I achieve this?

I am considering a gem or sub-modules.

Kamilski81
  • 14,409
  • 33
  • 108
  • 161

2 Answers2

6

Extract the common code to a gem, or at the very least into a library structure (maybe in /lib ...) that you can isolate and manually include into your two projects.

Pavling
  • 3,933
  • 1
  • 22
  • 25
1

I suppose when you say share models, you imply activerecord models. You can create symlink to folder. Or something similar has been asked at Share Models between 2 Rails API's (Separate Applications)

Community
  • 1
  • 1
ch4nd4n
  • 4,110
  • 2
  • 21
  • 43