Created
January 26, 2021 18:31
-
-
Save jwoertink/6e66d5b4eefa9f82867bb7a40dad3795 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
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