I’ve a question about Rails 3 Engines. I’m looking everywhere for good
documentation on this subject, but didn’t find it.
I’m trying to create a mountable app (embedding a Rails application in
another Rails application). Both the ‘base’ application and the
‘embedded’ application are created with rails3.0.0.rc. To behave as
Engine the ‘embedded’ application has the following code in
‘lib/my_engine.rb’:
lib/my_engine.rb
require “my_engine”
require “rails”
module MyEngine
class Engine < Rails::Engine
end
end
In the Gemfile of the ‘base’ application I’ve included MyEngine as a
gem, using the path directive (to be able to change code without
rebuilding the gem).
Gemfile
gem “my_engine”, :path => “…/my_engine”
When I try to start the ‘base’ application it raises a NameError:
‘lib/my_engine.rb’:
In the Gemfile of the ‘base’ application I’ve included MyEngine as a
Does anybody have good (Rails3 RC based) documentation on how to create
look comparing with your version.
–
Luis L.
I wish I saw that earlier.
Anyway, I did not find a lot of documentation about it, and so I did
test myself.
I created today a gem “app2engine” to convert the skeleton of a Rails
app to an Engine.
It seems very similar to enginex about the concept.
I use the standard path (so app/controllers for controllers), and so I
think it is using less configuration stuff.
Please have a look at it and file an issue if something goes wrong
Benoit D.
(Sorry for the noise on the Ruby list, I did not find the post on
rubyonrails-talk)