Skip to content

Instantly share code, notes, and snippets.

@dyoder
Created May 30, 2009 14:46
Show Gist options
  • Save dyoder/120522 to your computer and use it in GitHub Desktop.
Save dyoder/120522 to your computer and use it in GitHub Desktop.
class Blog
include Waves::Resource::Server
resource :list, :expires => 3.days, [ ‘blogs’ ] do
get { model.find_all }
end
resource :element, :expires => 3.days, [ ‘blog’, :name ] do
get { model.find_by_name( captured.name ) }
end
schema :element, [ 'schema', 'blog', '2009-03' ] do
attributes :title => String, :description => String
link :entries, :list => Story
end
representations :list do
as :html, :lang => :en do | blogs |
view( :blog ).list( blogs )
end
end
representations :element do
as :html, :lang => :en do | blog |
view( :blog ).show( blog )
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment