Is the use of components limited to render_component, or is it possible to build routes directly to components? I imagine the user could put Typo in approot/components/typo and RForum in approot/components/rforum and set up the following routes: map.connect ''forum/:controller/:action/:id'', :component => ''rforum'' map.connect ''blog/:controller/:action/:id'', :component => ''typo'' It would be even better to delegate the routing to the component: map.connect ''forum/:path'', :component => ''rforum'' map.connect ''blog/:path'', :component => ''typo'' This would make it much easier to combine different Rails apps without having to run multiple FastCGI servers. What do you think? Andreas
> I imagine the user could put Typo in approot/components/typo and > RForum in approot/components/rforum and set up the following routes: > map.connect ''forum/:controller/:action/:id'', :component => ''rforum'' > map.connect ''blog/:controller/:action/:id'', :component => ''typo''Components share the same namespace for controllers, so you can make routes just like you would to your own stuff. Albeit, you have to be explicit about the controllers you''re mapping to. Example: map.connect ''blog/:action/:id'', :controller => ''typo/blog'' Using :component as a way of dealing with multiple controllers per component could indeed be interesting. -- David Heinemeier Hansson, http://www.basecamphq.com/ -- Web-based Project Management http://www.rubyonrails.org/ -- Web-application framework for Ruby http://www.loudthinking.com/ -- Broadcasting Brain
David Heinemeier Hansson wrote:>> I imagine the user could put Typo in approot/components/typo and >> RForum in approot/components/rforum and set up the following routes: >> map.connect ''forum/:controller/:action/:id'', :component => ''rforum'' >> map.connect ''blog/:controller/:action/:id'', :component => ''typo'' > > > Components share the same namespace for controllers, so you can make > routes just like you would to your own stuff. Albeit, you have to be > explicit about the controllers you''re mapping to. Example: > > map.connect ''blog/:action/:id'', :controller => ''typo/blog'' > > Using :component as a way of dealing with multiple controllers per > component could indeed be interesting.I didn''t realize that components are only used for controllers and views. I thought about putting everything from the app/ directory in the component: components/xyz/models/ components/xyz/controllers/ components/xyz/views/ components/xyz/routing.rb (components/xyz/database.yml) That would make it almost trivial to combine two completely different Rails applications; however, I don''t think it would be trivial to implement.