Created
November 4, 2008 23:47
-
-
Save pete/22264 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyLayout | |
def show(&b) | |
doctype | |
html { | |
head { | |
link :rel => 'stylesheet', :href => '/stylesheets/site.css' | |
script :src => '/js/jquery.js' | |
} | |
body(:onload => 'return true;') { | |
yield | |
} | |
} | |
end | |
end | |
class StoryView < NiceHTML::View[:html4] | |
include MyLayout | |
def show(title, summary, body) | |
super() { | |
h2 title | |
div(:class => 'story') { | |
safe body | |
} | |
} | |
self | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment