aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides
diff options
context:
space:
mode:
authorSebastian Martinez <sebastian@wyeworks.com>2011-04-14 21:26:20 -0300
committerSebastian Martinez <sebastian@wyeworks.com>2011-04-14 21:26:20 -0300
commitba8a71588d8f3206b92c3e176c0b55529904a488 (patch)
treed314c29df48dc49e4b834292cdb811094b03d939 /railties/guides
parentbbfc6cda82b9550bfc955ecf66c0b803e3002e0a (diff)
downloadrails-ba8a71588d8f3206b92c3e176c0b55529904a488.tar.gz
rails-ba8a71588d8f3206b92c3e176c0b55529904a488.tar.bz2
rails-ba8a71588d8f3206b92c3e176c0b55529904a488.zip
Added more detailed use of the +list+ command on debugging guide
Diffstat (limited to 'railties/guides')
-rw-r--r--railties/guides/source/debugging_rails_applications.textile35
1 files changed, 35 insertions, 0 deletions
diff --git a/railties/guides/source/debugging_rails_applications.textile b/railties/guides/source/debugging_rails_applications.textile
index 045b8823ca..507b0d7ec9 100644
--- a/railties/guides/source/debugging_rails_applications.textile
+++ b/railties/guides/source/debugging_rails_applications.textile
@@ -328,6 +328,41 @@ If you repeat the +list+ command, this time using just +l+, the next ten lines o
And so on until the end of the current file. When the end of file is reached, the +list+ command will start again from the beginning of the file and continue again up to the end, treating the file as a circular buffer.
+On the other hand, to see the previous ten lines you should type +list-+ (or +l-+)
+
+<shell>
+(rdb:7) l-
+[1, 10] in /PathToProject/posts_controller.rb
+ 1 class PostsController < ApplicationController
+ 2 # GET /posts
+ 3 # GET /posts.xml
+ 4 def index
+ 5 debugger
+ 6 @posts = Post.all
+ 7
+ 8 respond_to do |format|
+ 9 format.html # index.html.erb
+ 10 format.xml { render :xml => @posts }
+</shell>
+
+This way you can move inside the file, being able to see the code above and over the line you added the +debugger+.
+Finally, to see where you are in the code again you can type +list=+
+
+<shell>
+(rdb:7) list=
+[1, 10] in /PathToProject/posts_controller.rb
+ 1 class PostsController < ApplicationController
+ 2 # GET /posts
+ 3 # GET /posts.xml
+ 4 def index
+ 5 debugger
+=> 6 @posts = Post.all
+ 7
+ 8 respond_to do |format|
+ 9 format.html # index.html.erb
+ 10 format.xml { render :xml => @posts }
+</shell>
+
h4. The Context
When you start debugging your application, you will be placed in different contexts as you go through the different parts of the stack.