I’m wondering if there is possibility to make multiple ‘apps’ under
one Rails Application. That is multiple app directories but sharing
the same server, the same configuration, etc. One might be ‘admin’ and
the other — ‘user’… Some directories (models) might be shared via
symlink. The reason is that I don’t want to have collisions with
controllers/views for managing the same data (eg. comments). Such idea
is in Symfony. What do you think?
I’ve been developing small PHP framework (similar to Rails in
structure) and I have solved this with the following:
app — default application, contains shared directories (models,
helpers, common application_controller, etc.)
app:admin — app1 named ‘admin’ — controllers for admin interface
app:service — etc
app:user — etc
In routing I have additional special parameter named ‘application’, it
looks like this:
Fails::$router->with (array (‘application’ => ‘admin’, ‘path_prefix’
routes for admin controllers here
I didn’t like app/admin, app/user structure (like in Symfony), because
it’s too much burden going up and down directory trees. IMO flat
structure is more convenient.
I’m sure that similar concept could be implemented in Rails. And if
someone didn’t like it, he could just simply not use it. Does someone
know how to hack Rails to do this?