Created
August 13, 2008 14:51
-
-
Save george/5237 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
class HomePageController < ApplicationController | |
# this ensures 'current_user' is populated with the logged in user | |
before_filter :login_required | |
def index | |
# populate an ivar (instance variable) so we can use it in the view | |
@user = current_user | |
@lists = @user.lists | |
@other_things_the_user_owns = @user.other_things_the_user_owns | |
end | |
end | |
# routes.rb | |
map.root :controller => 'home_page' # :action => 'index' is superfluous as it is the default |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment