Created
January 28, 2013 19:29
-
-
Save pwightman/4658304 to your computer and use it in GitHub Desktop.
This file contains 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 UsersController | |
before_filter :get_user, only: [:show, :update] | |
def show | |
# You can use the @user variable here... | |
end | |
def update | |
# You can use the @user variable here... | |
end | |
def index | |
# You CANNOT use the @user variable here... | |
end | |
private | |
def get_user | |
@user = User.find_by_id(params[:id]) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment