Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix 404 output

  • Loading branch information...
commit 0d1b7c7dee4e40521991190363396e8e696935c2 1 parent 0434132
Yehuda Katz wycats authored
Showing with 11 additions and 5 deletions.
  1. +4 −0 Rules
  2. +2 −2 layouts/default.html
  3. +5 −3 lib/helpers/subnav.rb
4 Rules
View
@@ -32,6 +32,10 @@ compile '*' do
layout 'main'
end
+route "/404/" do
+ "/404.html"
+end
+
route %r{^\/(js|css|img|favicon)} do
filename = item.attributes[:filename].sub(%r{content/}, '')
"/#{filename}"
4 layouts/default.html
View
@@ -85,7 +85,7 @@ <h1 id="logo">
<%= yield %>
</div>
<div id="modals">
- <%= @item[:content_for_modals] %>
+ <%= content_for_modals %>
</div>
</div>
<footer>
@@ -172,4 +172,4 @@ <h1 id="logo">
</script>
</body>
-</html>
+</html>
8 lib/helpers/subnav.rb
View
@@ -1,15 +1,17 @@
module SubnavHelper
+ def content_for_modals
+ @content_for_modals ||= ''
+ end
+
def subnav(*tabs)
render 'subnav', :tab_names => tabs
end
def modal(id, &block)
- @item[:content_for_modals] ||= ''
-
content = capture(&block)
result = render 'modal', :content => content, :id => id
- item[:content_for_modals] << result
+ content_for_modals << result
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.