Created
March 17, 2011 23:41
-
-
Save etozzato/875376 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def load_user | |
| if params[:id] =~ /\D+/ | |
| @user = User.find_by_username(params[:id]) | |
| else | |
| @user = User.find_by_id(params[:id]) | |
| end | |
| raise ActiveRecord::RecordNotFound if @user.nil? | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment