<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -5,6 +5,7 @@ class BaseSiteGenerator &lt; Rails::Generator::Base
       m.file &quot;config/application.yml&quot;, &quot;config/application.yml&quot;
       m.file &quot;app/helpers/application_helper.rb&quot;, &quot;app/helpers/application_helper.rb&quot;
       m.directory &quot;app/views/common&quot;
+      m.file &quot;app/views/layouts/main.html.erb&quot;, &quot;app/views/layouts/main.html.erb&quot;
       m.file &quot;app/views/common/403.html.erb&quot;, &quot;app/views/common/403.html.erb&quot;
       m.file &quot;app/views/common/404.html.erb&quot;, &quot;app/views/common/404.html.erb&quot;
       m.file &quot;app/views/common/_analytics.html.erb&quot;, &quot;app/views/common/_analytics.html.erb&quot;</diff>
      <filename>base_site_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,18 +9,39 @@ module ApplicationHelper
     instance_variable_defined?(&quot;@content_for_#{name.to_s}&quot;)    
   end
   
-  def page_header(text)
+  # Wrap the page header content with this function so that it can be used as
+  # a fallback page title.
+  def page_header(text = nil, options = {}, &amp;block)
+    options[:id] ||= &quot;page_header&quot;
+    options[:class] ||= &quot;page_header&quot;
     content_for :page_header do
-      content_tag(:h2, text)
+      if block_given?
+        content_tag(:h2, capture(&amp;block), options)
+      else
+        content_tag(:h2, text, options)
+      end
     end
   end
   
-  def page_title(text)
+  # Set the page title.
+  def page_title(text = nil, &amp;block)
     content_for :page_title do
-      text
+      if block_given?
+        capture(&amp;block)
+      else
+        text
+      end
     end
   end
   
+  # Show the flash in an RJS template and then discard it so that it's not
+  # shown on the next page load. This allows you to avoid having to set the
+  # same flash message twice for actions that respond with RJS or HTML.
+  def rjs_flash(page)
+    page.replace &quot;flash&quot;, :partial =&gt; &quot;common/flash&quot;, :locals =&gt; {:flash =&gt; flash}
+    flash.discard
+  end  
+  
   def page_title_or_header
     text = @content_for_page_title || @content_for_page_header || ''
     strip_tags(text) + (text.include?(APP_CONFIG[&quot;site_name&quot;]) ? '' : &quot; - #{APP_CONFIG[&quot;site_name&quot;]}&quot;)</diff>
      <filename>templates/app/helpers/application_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>faedc6fcc30635fe7830ec5182c059b3ea60e2a0</id>
    </parent>
  </parents>
  <author>
    <name>Norman Clarke</name>
    <email>norman@addthree.com</email>
  </author>
  <url>http://github.com/norman/base-site-generator/commit/8bf3870661ebee4340a2b9adabcb8f7d0da7f336</url>
  <id>8bf3870661ebee4340a2b9adabcb8f7d0da7f336</id>
  <committed-date>2008-08-18T07:39:30-07:00</committed-date>
  <authored-date>2008-08-18T07:39:30-07:00</authored-date>
  <message>Made page_header and page_title use blocks. Added rjs_flash helper.</message>
  <tree>671076cba775151d8eea8f65876f064ec9cbe1d3</tree>
  <committer>
    <name>Norman Clarke</name>
    <email>norman@addthree.com</email>
  </committer>
</commit>
