Skip to content

Instantly share code, notes, and snippets.

@dyoder
Created May 29, 2009 22:54
Show Gist options
  • Save dyoder/120257 to your computer and use it in GitHub Desktop.
Save dyoder/120257 to your computer and use it in GitHub Desktop.
representation "text/html", "application/xhtml+xml" do
transitions do
view "Edit page", Site/Page/URL, "application/vnd.com.example.wiki.page.editable"
view "View raw contents", Site/Page/URL, "text/plain"
view "Show page history", Site/History/URL
view "Other pages under #{path}", Site/Pages/path
end
response_is("text/html") { processor.call request }
rendered_by Hoshi, :from => "p/page.rb"
end
representation "application/vnd.com.example.wiki.page.editable" do
transitions do
view "Cancel Editing", Site/Page/URL # GET default MIME
view "View raw contents", Site/Page/URL, "text/plain"
view "Show page history", Site/History/URL
view "Other pages under #{path}", Site/Pages/path
delete "Delete This Page", Site/Page/URL # DELETE
update "Commit Your Changes", Site/Page/URL # POST
end
response_is("text/html") { processor.call request }
rendered_by Hoshi, :from => "p/editable_page.rb"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment