Skip to content

Commit

Permalink
Fix 404 output
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed May 30, 2011
1 parent 0434132 commit 0d1b7c7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Rules
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
4 changes: 2 additions & 2 deletions layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h1 id="logo">
<%= yield %>
</div>
<div id="modals">
<%= @item[:content_for_modals] %>
<%= content_for_modals %>
</div>
</div>
<footer>
Expand Down Expand Up @@ -172,4 +172,4 @@ <h2>Subscribe To Our Newsletter</h2>

</script>
</body>
</html>
</html>
8 changes: 5 additions & 3 deletions lib/helpers/subnav.rb
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 0d1b7c7

Please sign in to comment.