Installing multiple instances of the same engine in Rails 3

I want to use the new modularity perspectives offered by the architecture changes in rails 3. However, instead of just mounting the engine, as in most examples ...

Rails.application.routes.draw do match "/blog" => Rack::Blog end 

... I would like to install several versions of the same engines and configure these instances independently of each other. Something like lines ...

 Rails.application.routes.draw do match "/news" => Blog.new("path/to/blog_1/config") match "/blog" => Blog.new("path/to/blog_2/config") end 

Is such a feature useful? Has anyone implemented something like this?

Thanks fturtle

+4
source share
1 answer

My gut tells me no, because the namespace of the first implementation will tread on the socks of the second. Although, since the files will be the same, I think it would not matter? How did you end up in the end?

+1
source

Source: https://habr.com/ru/post/1316592/


All Articles