Created
July 30, 2009 06:17
-
-
Save hakunin/158592 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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