Skip to content

Instantly share code, notes, and snippets.

@wycats
Created November 10, 2008 05:13
Show Gist options
  • Save wycats/23424 to your computer and use it in GitHub Desktop.
Save wycats/23424 to your computer and use it in GitHub Desktop.
Merb::Router.prepare do
resources :foos
end
class Foos < Application
def show(foo)
# here you have access to the foo resource (either the raw DM object or a wrapper)
end
end
# request /foo/1 routes to Foos#show(Foo.get(1)) or Foos#show(resource_wrapper)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment