Skip to content

Instantly share code, notes, and snippets.

@Poincare
Created September 12, 2012 01:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Poincare/3703680 to your computer and use it in GitHub Desktop.
module Nuts::Controllers
class Words < R '/welcome/to/my/site'
def get
"You got here by: /welcome/to/my/site"
end
end
class Digits < R '/nuts/(\d+)'
def get(number)
"You got here by: /nuts/#{number}"
end
end
class Segment < R '/gorp/([^/]+)'
def get(everything_else_than_a_slash)
"You got here by: /gorp/#{everything_else_than_a_slash}"
end
end
class DigitsAndEverything < R '/nuts/(\d+)/([^/]+)'
def get(number, everything)
"You got here by: /nuts/#{number}/#{everything}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment