concept current_user in category rails

appears as: current_user, current_user
Flexible Rails: Flex 3 on Rails 2

This is an excerpt from Manning's book Flexible Rails: Flex 3 on Rails 2.

We create a new method called create_xml in the SessionsController. It’s a copy-paste-modify of the create method which was created for us. (We don’t worry about refactoring the duplicated code out into a method, because we know we’ll be refactoring this later when we convert to REST.) Upon successful login, we render XML of the current_user . If the login fails, we render the text "badlogin" .

We start by replacing the Task.find(:all) with current_user.tasks . But right now this looks like magic: Where did current_user.tasks come from? Heck, where did current_user come from? Before we can proceed to fix the TasksController, we should figure this out.