Prev: Ruby PRAWN PDF
Next: Error with Gem Outdated command
From: H.J. Blok on 4 Aug 2010 07:33 Hello, 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: uninitialized constant MyEngine::Application (NameError) Does anybody have good (Rails3 RC based) documentation on how to create a mountable app? And what would be the 'Rails-way' of solving this problem? Kind regards, Harm-Jan -- Posted via http://www.ruby-forum.com/.
From: H.J. Blok on 4 Aug 2010 07:33 sorry wrong forum.... -- Posted via http://www.ruby-forum.com/.
From: Luis Lavena on 4 Aug 2010 07:48 On Aug 4, 8:33 am, "H.J. Blok" <hj.b...(a)gmail.com> wrote: > Hello, > > 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: > > uninitialized constant MyEngine::Application (NameError) > > Does anybody have good (Rails3 RC based) documentation on how to create > a mountable app? > > And what would be the 'Rails-way' of solving this problem? > Please look at enginex: http://github.com/josevalim/enginex It creates an engine template for rails 3, generate one and take a look comparing with your version. Indeed there is no plenty of documentation, so you should inspect by example. Also, you will get more help and better responses in a Ruby on Rails group/mailing list, like ror talk: http://groups.google.com/group/rubyonrails-talk HTH, -- Luis Lavena
From: H.J. Blok on 4 Aug 2010 07:59 Luis Lavena wrote: > Please look at enginex: > > http://github.com/josevalim/enginex > > It creates an engine template for rails 3, generate one and take a > look comparing with your version. Thanks, I'll try generating a Engine using enginex and compare it with my version. > Also, you will get more help and better responses in a Ruby on Rails > group/mailing list, like ror talk: > > http://groups.google.com/group/rubyonrails-talk I already did (forgot to select Rails Forum while creating this topic). HJ -- Posted via http://www.ruby-forum.com/.
From: H.J. Blok on 4 Aug 2010 09:05
H.J. Blok wrote: > Luis Lavena wrote: > >> Please look at enginex: >> >> http://github.com/josevalim/enginex >> >> It creates an engine template for rails 3, generate one and take a >> look comparing with your version. > > Thanks, I'll try generating a Engine using enginex and compare it with > my version. Do you know how to use enginex? I've tried, but there is no documentation on usage (other than enginex NAME). HJ -- Posted via http://www.ruby-forum.com/. |