Markaby - Camping

Camping

Markaby is the templating engine used for the Camping micro web framework.

module HomePage::Views # If you have a `layout' method like this, it # will wrap the HTML in the other methods. The # `self << yield' is where the HTML is inserted. def layout html do title { 'My HomePage' } body { self << yield } end end # The `index' view. Inside your views, you express # the HTML in Ruby. See http://code.whytheluckystiff.net/markaby/. def index p 'Hi my name is Charles.' p 'Here are some links:' ul do li { a 'Google', :href => 'http://google.com/' } li { a 'A sample page', :href => '/sample' } end end # The `sample' view. def sample p 'A sample page' end end

Read more about this topic:  Markaby

Famous quotes containing the word camping:

    An Illinois woman has invented a portable house which can be carried about in a cart or expressed to the seashore. It has also folding furniture and a complete camping outfit.
    Lydia Hoyt Farmer (1842–1903)