Share Models between 2 Rails API's (Separate Applications)

前端 未结 5 794
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-29 05:24

I\'m currently building 2 API\'s using Ruby on Rails. One if for reading (finding objects, querying) and the other one is for actually writing to it, involving a kind of com

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-29 06:01

    My trick for doing this is to not actually use Rails tricks. I use "git" tricks, and pull in code from a 3rd, shared-code repo. I put this into both apps as an engine, and as an external git reference.

    It's a little more work, but once you have done it once in one app, it's easy to use that as a template for the next one, too.

提交回复
热议问题