Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8770: update_to_debug_section_on_front_readme.diff

File update_to_debug_section_on_front_readme.diff, 2.2 kB (added by mikel, 1 year ago)

Updated text to make it read better

  • railties/README

    old new  
    6464 
    6565== Debugging Rails 
    6666 
    67 Have "tail -f" commands running on the server.log and development.log. Rails will 
    68 automatically display debugging and runtime information to these files. Debugging 
    69 info will also be shown in the browser on requests from 127.0.0.1. 
     67Sometimes your application goes wrong.  Fortunately there are a lot of tools that 
     68will help you debug it and get it back on the rails. 
    7069 
     70First area to check is the application log files.  Have "tail -f" commands running 
     71on the server.log and development.log. Rails will automatically display debugging 
     72and runtime information to these files. Debugging info will also be shown in the 
     73browser on requests from 127.0.0.1. 
    7174 
     75You can also log your own messages directly into the log file from your code using 
     76the Ruby logger class from inside your controllers. Example: 
     77 
     78  class WeblogController < ActionController::Base 
     79    def destroy 
     80      @weblog = Weblog.find(params[:id]) 
     81      @weblog.destroy 
     82      logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!") 
     83    end 
     84  end 
     85 
     86The result will be a message in your log file along the lines of: 
     87 
     88  Destroyed Weblog ID #1 
     89 
     90More information on how to use the logger is at http://www.ruby-doc.org/core/ 
     91 
     92Also, Ruby documentation can be found at http://www.ruby-lang.org/ including: 
     93 
     94* The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/ 
     95* Learn to Program: http://pine.fm/LearnToProgram/  (a beginners guide) 
     96 
     97These two online (and free) books will bring you up to speed on the Ruby language 
     98and also on programming in general. 
     99 
     100 
    72101== Debugger 
    73102 
    74103Debugger support is available through the debugger command when you start your Mongrel or 
    75 Webrick server with --debugger. This means that you can break out of execution at any point in the code, investigate 
    76 and change the model, AND then resume execution! Example: 
     104Webrick server with --debugger. This means that you can break out of execution at any point 
     105in the code, investigate and change the model, AND then resume execution! Example: 
    77106 
    78107  class WeblogController < ActionController::Base 
    79108    def index