I have several views that I would like to appear on every view that displays, but without duplicating code or violating specifications, I cannot find a way to accomplish this.
Here is my current code, dialing calls in all views:
def ImOnABoat :: Views
def layout
html do
head do title "Petstore" end
body do yield end
end
end
def navigation
p "Welcome to our tiny petstore!"
end
def poodle
navigation # Have to duplicate this in every view
p "We have a poodle!"
end
def fluffy_bunny
navigation # Have to duplicate this in every view
p "Come see-- OH CRAP IT A VELOCIRAPTOR!"
end
end
, , , , .
def layout
def head do title "Petstore" end
nav # This is not inside <body>!
def body do yield end
end