Skip to content

Instantly share code, notes, and snippets.

@jwoertink
Created January 26, 2021 18:31
Show Gist options
  • Save jwoertink/6e66d5b4eefa9f82867bb7a40dad3795 to your computer and use it in GitHub Desktop.
Save jwoertink/6e66d5b4eefa9f82867bb7a40dad3795 to your computer and use it in GitHub Desktop.
abstract class StoragePageLayout
include Lucky::HTMLBuilder
getter view = IO::Memory.new
abstract def content
def render
html_doctype
html do
head do
body do
content
end
end
end
def render_to_string
String.build do |io|
@view = io
render
end
end
end
class Thing::IndexPage < StoragePage
def render
h1 "hi"
end
end
Thing::IndexPage.new.render_to_string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment