diff options
author | Michael Koziarski <michael@koziarski.com> | 2007-10-08 05:32:50 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2007-10-08 05:32:50 +0000 |
commit | 994c9cf0c4fa78764cf0bca2c99bc01376339749 (patch) | |
tree | 61a93e0abb495de26eefdf233312f6c939a410e2 /railties | |
parent | 346d36bfbade219f9dd04fad94e9eca1c796946c (diff) | |
download | rails-994c9cf0c4fa78764cf0bca2c99bc01376339749.tar.gz rails-994c9cf0c4fa78764cf0bca2c99bc01376339749.tar.bz2 rails-994c9cf0c4fa78764cf0bca2c99bc01376339749.zip |
Improve README documentation. References #8770 [mikel]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7796 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r-- | railties/README | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/railties/README b/railties/README index 57d316e927..11108795bf 100644 --- a/railties/README +++ b/railties/README @@ -64,16 +64,45 @@ please visit: http://wiki.rubyonrails.com/rails/pages/FastCGI == Debugging Rails -Have "tail -f" commands running on the server.log and development.log. Rails will -automatically display debugging and runtime information to these files. Debugging -info will also be shown in the browser on requests from 127.0.0.1. +Sometimes your application goes wrong. Fortunately there are a lot of tools that +will help you debug it and get it back on the rails. + +First area to check is the application log files. Have "tail -f" commands running +on the server.log and development.log. Rails will automatically display debugging +and runtime information to these files. Debugging info will also be shown in the +browser on requests from 127.0.0.1. + +You can also log your own messages directly into the log file from your code using +the Ruby logger class from inside your controllers. Example: + + class WeblogController < ActionController::Base + def destroy + @weblog = Weblog.find(params[:id]) + @weblog.destroy + logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!") + end + end + +The result will be a message in your log file along the lines of: + + Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1 + +More information on how to use the logger is at http://www.ruby-doc.org/core/ + +Also, Ruby documentation can be found at http://www.ruby-lang.org/ including: + +* The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/ +* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide) + +These two online (and free) books will bring you up to speed on the Ruby language +and also on programming in general. == Debugger Debugger support is available through the debugger command when you start your Mongrel or -Webrick server with --debugger. This means that you can break out of execution at any point in the code, investigate -and change the model, AND then resume execution! Example: +Webrick server with --debugger. This means that you can break out of execution at any point +in the code, investigate and change the model, AND then resume execution! Example: class WeblogController < ActionController::Base def index |