diff --git a/lib/erector/rails/railtie.rb b/lib/erector/rails/railtie.rb index 22f966f..d3f6549 100644 --- a/lib/erector/rails/railtie.rb +++ b/lib/erector/rails/railtie.rb @@ -7,5 +7,7 @@ class Railtie < ::Rails::Railtie # works. For now, you must add the following to config/application.rb: # # config.autoload_paths += %W(#{config.root}/app) + # + # (Maybe ::Rails.configuration.autoload_paths will work?) end end diff --git a/web/rails.html b/web/rails.html index 5a777bb..965a75a 100644 --- a/web/rails.html +++ b/web/rails.html @@ -238,7 +238,7 @@
config/environment.rb
. You also should delete (or rename) any other view files with the same base name that might be getting in the way.
+ You must also add app to the class load path. Put this line into
+ config/application.rb
+
config.autoload_paths += %W(#{config.root}/app)+
Currently there is only partial support for some standard Rails features like partials, layouts, assigns, and helpers. Check the erector Google Groups mailing list for status updates on these features.
Notice how this mechanism allows you to...
all in a straightforward, easily understood paradigm (OO inheritance). (No more weird yielding to invisible, undocumented closures!)
-Check out Erector::Widgets::Page for a widget that does a lot of this for you, including rendering externals in the HEAD element.
- -Check out Erector::Widgets::Page for a widget that does a lot of this for you, including rendering externals in the HEAD element.
To use layout inheritance in Rails, declare
layout nil
in
app/controllers/application.rb
- and then define your Page parent class as
+ (or in an individual controller class) and then define your Page parent class as
class Views::Layouts::Page
in
app/views/layouts
as usual.
To use an Erector widget as a regular Rails layout, you'll have to set things up a bit differently.
app/views/layouts/application.rb:
class Views::Layouts::Application < Erector::Widget diff --git a/web/rails.rb b/web/rails.rb index 08646e6..f4408c6 100644 --- a/web/rails.rb +++ b/web/rails.rb @@ -88,6 +88,12 @@ def content text ". You also should delete (or rename) any other view files with the same base name that might be getting in the way." end + p { + text "You must also add app to the class load path. Put this line into " + code "config/application.rb" + pre 'config.autoload_paths += %W(#{config.root}/app)' + } + p do text "Currently there is only partial support for some standard Rails features like partials, layouts, assigns, and helpers. Check the " a "erector Google Groups mailing list", :href => "http://googlegroups.com/group/erector" diff --git a/web/readme.html b/web/readme.html index 90d456f..932731a 100644 --- a/web/readme.html +++ b/web/readme.html @@ -232,6 +232,8 @@
The gem depends on rake and treetop, although this is just for using the -command-line tool, so deployed applications won’t need these. The -Rails-dependent code is now separated so you can use Erector cleanly in a +command-line tool, so deployed applications won’t need these. The +Rails-dependent code is now separated so you can use Erector cleanly in a non-Rails app.