Permalink
Browse files

better config.autoload_paths instructions

  • Loading branch information...
1 parent 13f831a commit 019e8dec095af7f17d6db3bfcbf0471ff44f9e87 @alexch alexch committed Aug 15, 2012
Showing with 22 additions and 8 deletions.
  1. +2 −0 lib/erector/rails/railtie.rb
  2. +10 −6 web/rails.html
  3. +6 −0 web/rails.rb
  4. +4 −2 web/readme.html
@@ -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
View
@@ -238,7 +238,7 @@ <h1 class="name">Erector On Rails</h1>
<li><a href="#rails">Using Erector from Ruby on Rails</a></li>
<li><a href="#tool">Erector tool: Command-line conversion to and from HTML</a></li>
<li><a href="#pagelayoutinheritance">Page Layout Inheritance</a></li>
- <li><a href="#erectorlayoutsinrails">Erector Layouts in Rails</a></li>
+ <li><a href="#erectorwidgetsasrailslayouts">Erector Widgets as Rails Layouts</a></li>
<li><a href="#instancevariables">Instance Variables</a></li>
<li><a href="#moreaboutrails">More about Rails</a></li>
</ol>
@@ -295,6 +295,10 @@ <h1 class="name">Erector On Rails</h1>
to
<code>config/environment.rb</code>
. You also should delete (or rename) any other view files with the same base name that might be getting in the way.</p>
+ <p>You must also add app to the class load path. Put this line into
+ <code>config/application.rb</code>
+ <pre>config.autoload_paths += %W(#{config.root}/app)</pre>
+ </p>
<p>Currently there is only partial support for some standard Rails features like partials, layouts, assigns, and helpers. Check the <a href="http://googlegroups.com/group/erector">erector Google Groups mailing list</a> for status updates on these features.</p>
<a name="tool"></a>
<h2>3. Erector tool: Command-line conversion to and from HTML</h2>
@@ -388,24 +392,24 @@ <h1 class="name">Erector On Rails</h1>
</p>
<p>Notice how this mechanism allows you to...</p>
<ul>
- <li>Set instance variables (e.g. title)</li>
+ <li>Set instance variables (e.g. page_title)</li>
<li>Override sections completely (e.g. render_body)</li>
<li>Append to standard content (e.g. render_navbar)</li>
<li>Use standard content unchanged (e.g. render_footer)</li>
</ul>
<p>all in a straightforward, easily understood paradigm (OO inheritance). (No more weird yielding to invisible, undocumented closures!)</p>
- <p>Check out <a href="/rdoc/Erector/Widgets/Page.html">Erector::Widgets::Page</a> for a widget that does a lot of this for you, including rendering <a href="#externals">externals</a> in the HEAD element.</p>
- <a name="erectorlayoutsinrails"></a>
- <h2>5. Erector Layouts in Rails</h2>
+ <p>Check out <a href="/rdoc/Erector/Widgets/Page.html">Erector::Widgets::Page</a> for a widget that does a lot of this for you, including rendering <a href="userguide.html#externals">externals</a> in the HEAD element.</p>
<p>To use layout inheritance in Rails, declare
<code>layout nil</code>
in
<code>app/controllers/application.rb</code>
- and then define your Page parent class as
+ (or in an individual controller class) and then define your Page parent class as
<code>class Views::Layouts::Page</code>
in
<code>app/views/layouts</code>
as usual.</p>
+ <a name="erectorwidgetsasrailslayouts"></a>
+ <h2>5. Erector Widgets as Rails Layouts</h2>
<p>To use an Erector widget as a regular Rails layout, you'll have to set things up a bit differently.<br />
<code>app/views/layouts/application.rb:</code>
<pre class="sh_ruby">class Views::Layouts::Application &lt; Erector::Widget
View
@@ -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"
View
@@ -232,6 +232,8 @@
</li><li>
<p><a href="mailto:erector@googlegroups.com">erector@googlegroups.com</a></p>
</li><li>
+<p><a href="http://github.com/pivotal/erector">github.com/pivotal/erector</a></p>
+</li><li>
<p><a
href="http://www.pivotaltracker.com/projects/482">www.pivotaltracker.com/projects/482</a></p>
</li></ul>
@@ -281,8 +283,8 @@ <h2 id="label-SYNOPSIS">SYNOPSIS</h2>
<h2 id="label-REQUIREMENTS">REQUIREMENTS</h2>
<p>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.</p>
<h2 id="label-INSTALL">INSTALL</h2>

0 comments on commit 019e8de

Please sign in to comment.