Skip to content

Instantly share code, notes, and snippets.

@hakunin
Created July 30, 2009 06:17
Show Gist options
  • Select an option

  • Save hakunin/158592 to your computer and use it in GitHub Desktop.

Select an option

Save hakunin/158592 to your computer and use it in GitHub Desktop.
include PocketRuby
class PlanningGame < Application
# domain objects
class Programmer < Record
Block.describe(self, {
:name => Title,
:special_skills => Text,
:weaknes_to => Text,
:action_points => IntegerBlock
})
end
class Task < Record
Block.describe(self, {
:name => Title,
:hours => IntegerBlock,
:programmer => BelongsTo.new(Programmer),
:description => Text,
:state => StringBlock
})
end
#site structure
class PlanningGame < SiteRoot
def initialize
super
map :index => Task.public.list
map :programmers => Programmer.public.list
self.layout = PlanningGameLayout
end
end
#views
class PlanningGameLayout < View
def template
lambda {
html {
head { title "Planning game" }
}
h1 "Planning game time!"
a 'tasks', :href => '/'
add ' | '
a 'programmers', :href => '/programmers'
div(@content, :class=>'content')
}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment