Hi, 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'' => ''admin'')); # routes for admin controllers here Fails::$router->without(); 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? Best.regards()
On Aug 2, 4:22 pm, mcv <m...-FWhLrETftxM@public.gmane.org> wrote:> Hi, > > 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? >Well you can certainly namespace your controllers, eg /admin/comment mapping to Admin::CommentsController and so on. If you don''t like having that /admin there (not sure what you mean about going up and down directory trees being too much burden) you could set your routes so that the paths were different/ Fred> 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'' > => ''admin'')); > # routes for admin controllers here > Fails::$router->without(); > > 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? > > Best.regards()
> > I''m wondering if there is possibility to makemultiple''apps'' under > > one Rails Application. That ismultipleapp 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? > > Well you can certainly namespace your controllers, eg /admin/comment > mapping to Admin::CommentsController and so on.That''s it. I didn''t know Rails have had namespaces. :-)> (not sure what you mean about going up and > down directory trees being too much burden)I use Midnight Commander, so if there are too many levels of directories my arrow/home/end keys wear very quickly. ;-) Best.regards()