Skip to content

Instantly share code, notes, and snippets.

@pete
Created November 4, 2008 23:47
Show Gist options
  • Save pete/22264 to your computer and use it in GitHub Desktop.
Save pete/22264 to your computer and use it in GitHub Desktop.
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