aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/rails_guides
diff options
context:
space:
mode:
Diffstat (limited to 'railties/guides/rails_guides')
-rw-r--r--railties/guides/rails_guides/generator.rb11
-rw-r--r--railties/guides/rails_guides/helpers.rb4
2 files changed, 13 insertions, 2 deletions
diff --git a/railties/guides/rails_guides/generator.rb b/railties/guides/rails_guides/generator.rb
index 670d2bc4db..e30dd2d5f7 100644
--- a/railties/guides/rails_guides/generator.rb
+++ b/railties/guides/rails_guides/generator.rb
@@ -88,6 +88,10 @@ module RailsGuides
warn_about_broken_links(result) if ENV.key?("WARN_BROKEN_LINKS")
end
+ # FIXME: If the doctype is in the layout textile escapes it.
+ # Things should be set up in a way that prevents that, a doctype
+ # belongs to the layout.
+ result = insert_doctype(result)
result = insert_edge_badge(result) if ENV.key?('INSERT_EDGE_BADGE')
f.write result
end
@@ -199,6 +203,13 @@ module RailsGuides
end
end
end
+
+ def insert_doctype(html)
+ <<EOS + html
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+EOS
+ end
def insert_edge_badge(html)
html.sub(/<body[^>]*>/, '\&<img src="images/edge_badge.png" style="position:fixed; right:0px; top:0px; border:none; z-index:100"/>')
diff --git a/railties/guides/rails_guides/helpers.rb b/railties/guides/rails_guides/helpers.rb
index e05793d40e..bf99538696 100644
--- a/railties/guides/rails_guides/helpers.rb
+++ b/railties/guides/rails_guides/helpers.rb
@@ -9,7 +9,7 @@ module RailsGuides
end
result << content_tag(:dd, capture(&block))
- concat(result)
+ result
end
def lh(id, label = "Lighthouse Ticket")
@@ -23,7 +23,7 @@ module RailsGuides
result = content_tag(:img, nil, :src => image, :class => 'left pic', :alt => name)
result << content_tag(:h3, name)
result << content_tag(:p, capture(&block))
- concat content_tag(:div, result, :class => 'clearfix', :id => nick)
+ content_tag(:div, result, :class => 'clearfix', :id => nick)
end
def code(&block)