Alexey Zakharov
Alexey Zakharov

Reputation: 25110

How can I create separate Rails applications that shares same models?

I've got web application and api.

Web application and api will run on separate servers.

How can I share model classes between them?

Upvotes: 0

Views: 129

Answers (1)

ginie
ginie

Reputation: 81

You could write a gem with the models you want to share. Then use the gem in both applications.

Another way would be to use the same application on both servers where the application and the api are both implemented. Then one could disable the app/api depend on the domain.

Upvotes: 2

Related Questions