0

I have a couple of pre-existing applications which I need to run in "one" app. One is the application I want to use for authentication etc, whilst the other is another app that contains all of the business logic.

Both apps have pre-existing authentication, and both have fairly complex user models.

Is it possible to easily combine these so that if I log into one application and create a user, that same data is available in the other - or something similar?

What is the easiest way of doing this? Can a rails model extend a REST webservice?

Neil Middleton
  • 22,105
  • 18
  • 80
  • 134

2 Answers2

1

You can use the new(ish) Engine feature to embed one app inside another. Your engine lives inside vendor/plugins, can have all of it's own routes and config setup just like a normal rails application but actually share the database. Makes combining applications really easy. We use it with git submodules to make management of complex applications seamless.

Toby Hede
  • 36,755
  • 28
  • 133
  • 162
  • One catch is that you will have to copy the public/ files though. You would not have that problem if you use the Engine's plugin. – andHapp Oct 25 '09 at 15:41
0

I'd use warden (or devise, which is built on it) for the authentication. Warden is rack-based, and can therefore be used in both apps aka single-sign-on.

Reactormonk
  • 21,472
  • 14
  • 74
  • 123