Skip to content

Instantly share code, notes, and snippets.

@dira
Created March 1, 2009 19:09
Show Gist options
  • Save dira/72437 to your computer and use it in GitHub Desktop.
Save dira/72437 to your computer and use it in GitHub Desktop.
# model:
def to_param
login.parameterize
end
# for controllers (the User controller and all the controllers that are
# nested under it, or in other namespaces): replace User.find(params[:id]) with
User.find_by_login(params[:id])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment