summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authormakoto kuwata <kwa@kuwata-lab.com>2006-09-19 11:56:44 +0000
committermakoto kuwata <kwa@kuwata-lab.com>2006-09-19 11:56:44 +0000
commitb8f6776aa5074f2f191e25e2460cd7b8be7bf320 (patch)
tree6bce3bbd1c0fd33e5d959af885db2e6cd6a11572 /doc
parent90482329dc45b6b93c0f4052cf44ab4612942fef (diff)
downloaderubis-b8f6776aa5074f2f191e25e2460cd7b8be7bf320.tar.gz
- [update] ReleaseNote.txt, README.txt, doc/users-guide.txt
- [change] 'examples/pi' is renamed to 'examples/pi-xhtml'
Diffstat (limited to 'doc')
-rw-r--r--doc/users-guide.html20
-rw-r--r--doc/users-guide.txt20
2 files changed, 35 insertions, 5 deletions
diff --git a/doc/users-guide.html b/doc/users-guide.html
index c206f34..e28b08f 100644
--- a/doc/users-guide.html
+++ b/doc/users-guide.html
@@ -127,7 +127,7 @@ It has the following features.
<ul>
<li><a href="#topics-tinyeruby">TinyEruby class</a>
</li>
- <li><a href="#topics-rails">Rails Support</a>
+ <li><a href="#topics-rails">Ruby on Rails Support</a>
</li>
<li><a href="#topics-php">NoTextEnhancer and NoCodeEnhancer in PHP</a>
</li>
@@ -1881,7 +1881,7 @@ try TinyEruby class.
<a name="topics-rails"></a>
-<h3 class="section2">Rails Support</h3>
+<h3 class="section2">Ruby on Rails Support</h3>
<p>Erubis supports Ruby on Rails.
Add the following code to your 'app/controllers/application.rb'.
</p>
@@ -1889,12 +1889,26 @@ Add the following code to your 'app/controllers/application.rb'.
app/controllers/application.rb</div>
<pre class="program">require 'erubis/helper/rails'
suffix = 'erubis'
-ActionView::Base.register_template_handler("erubis", Erubis::Helper::RailsTemplate)
+ActionView::Base.register_template_handler(suffix, Erubis::Helper::RailsTemplate)
#Erubis::Helper::RailsTemplate.engine_class = Erubis::EscapedEruby ## or Erubis::PI::Eruby
#Erubis::Helper::RailsTemplate.default_properties = { :escape=&gt;true, :escapefunc=&gt;'h' }
</pre>
<p>If you specify Erubis::Helper::CachedRailsTemplate class instead of Erubis::Helper::RailsTemplate class, template string is cached in memory (but template is not reloaded when it is modified).
</p>
+<p>You may got the followign error:
+</p>
+<pre class="program">(eval):10:in `render': no block given
+</pre>
+<p>It is because layout file scaffold created contains 'yield' method.
+Use '@content_for_layout' instead 'yield'.
+</p>
+<div class="program_caption">
+app/views/layouts/xxx.erubis</div>
+<pre class="program"> ...
+ &lt;%<strong>#</strong>= yield %&gt;
+ <strong>&lt;%= @content_for_layout %&gt;</strong>
+ ...
+</pre>
<br>
diff --git a/doc/users-guide.txt b/doc/users-guide.txt
index 0acc9c7..379c371 100644
--- a/doc/users-guide.txt
+++ b/doc/users-guide.txt
@@ -1482,7 +1482,7 @@ If you don't need any enhancements of Erubis and only require simple eRuby imple
try TinyEruby class.
-.$$ Rails Support | topics-rails
+.$$ Ruby on Rails Support | topics-rails
Erubis supports Ruby on Rails.
Add the following code to your 'app/controllers/application.rb'.
@@ -1491,13 +1491,29 @@ Add the following code to your 'app/controllers/application.rb'.
.--------------------
require 'erubis/helper/rails'
suffix = 'erubis'
-ActionView::Base.register_template_handler("erubis", Erubis::Helper::RailsTemplate)
+ActionView::Base.register_template_handler(suffix, Erubis::Helper::RailsTemplate)
#Erubis::Helper::RailsTemplate.engine_class = Erubis::EscapedEruby ## or Erubis::PI::Eruby
#Erubis::Helper::RailsTemplate.default_properties = { :escape=>true, :escapefunc=>'h' }
.--------------------
If you specify Erubis::Helper::CachedRailsTemplate class instead of Erubis::Helper::RailsTemplate class, template string is cached in memory (but template is not reloaded when it is modified).
+You may got the followign error:
+.--------------------
+(eval):10:in `render': no block given
+.--------------------
+
+It is because layout file scaffold created contains 'yield' method.
+Use '@content_for_layout' instead 'yield'.
+
+.? app/views/layouts/xxx.erubis
+.--------------------
+ ...
+ <%{{*#*}}= yield %>
+ {{*<%= @content_for_layout %>*}}
+ ...
+.--------------------
+
.$$ NoTextEnhancer and NoCodeEnhancer in PHP | topics-php