[RAILS 3] 2 sup app in 1 app

Hi,

I’m building an app which will become quite big (I hope :wink: ) and so I
want to separate admin part and customers part. By separate, I mean not
2 namespaces (=1 app), but really 2 app (so I can shutdown customers and
keep admin access for example).
But, because the logic/model is the same, and some conf too, I would
like to keep it in one directory (a rails 3 app folder).
In rails 3, the app is a rack app, we have :

module XXXX
class Application < Rails::Application

So I was thinking of doing 2 app like this inside my application.rb

module XXXCustomers
class Application < Rails::Application

module XXXAdmin
class Application < Rails::Application

I could define the path for controllers and views
{controllers,views}/admin — {controllers,views}/customers

My questions/problems are

  • when I start the server how to tell it to start the admin app or the
    customers app. Maybe a rake parameter ?
  • is there other people who had try to do this
  • would you recommend me to use a different manner. For ex : share only
    the model between 2 “real” app
  • any other suggestions

Thanks


Nicolas

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs