Skip to content

Instantly share code, notes, and snippets.

@soveran
Created May 26, 2010 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soveran/415193 to your computer and use it in GitHub Desktop.
Save soveran/415193 to your computer and use it in GitHub Desktop.
class NilClass
def to_param
"all"
end
end
class Symbol
alias to_param to_s
end
class String
alias to_param dup
end
class Ohm::Model
alias to_param id
end
def url(*args)
"/" + args.map(&:to_param).join("/")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment