- Ruby
- Rubygems
- sqlite
- The Camping-gem
- Camping extras
If you need a detailed installation-guide, look at the camping-wiki.
Lets start our camping-trip with a jump in the cold water:
require 'camping'
Camping.goes :Simple
module Simple::Controllers
class Index < R '/'
def get
render :index
end
end
end
module Simple::Views
def layout
html do
head do
title 'my camping site'
end
body do
self << yield
end
end
end
def index
p "hello world"
end
end
Well, before I add some explanations, I recommend to play around with this very simple peace of code. What about adding a link, for example?
a "Google", :href => "http://www.google.com/"
Or adding a new page?
Explanations will follow, but you'll learn a lot by fiddling your way through some simple additions to the still very simple code.

1 comments:
Good words.
Post a Comment