Permalink
Browse files

debugging guide: revises the section on debugging RJS

  • Loading branch information...
fxn committed Aug 17, 2010
1 parent c11ba42 commit 4b21dfe9a71ca8d2b883f7e462a403d34eb2ce0b
Showing with 7 additions and 5 deletions.
  1. +7 −5 railties/guides/source/debugging_rails_applications.textile
@@ -96,22 +96,24 @@ Will be rendered as follows:
Title: Rails debugging guide
</pre>
-h4. Debugging JavaScript
+h4. Debugging RJS
-Rails has built-in support to debug RJS – to activate it, set +ActionView::Base.debug_rjs+ to _true_. This will specify that RJS responses should be wrapped in a try/catch block that displays the caught exception using +alert()+ (and then re-raises it).
+Rails has optional built-in support to debug RJS. When enabled, responses are wrapped in a try/catch block that displays the caught exception using +alert()+, and then re-raises it.
-To enable it, add the following in the +Rails::Initializer do |config|+ block inside +environment.rb+:
+The flag to enable RJS debugging in your configuration files is +config.action_view.debug_rjs+:
<ruby>
-config.action_view[:debug_rjs] = true
+config.action_view.debug_rjs = true
</ruby>
-Or, at any time, set +ActionView::Base.debug_rjs+ to _true_:
+or at any time setting +ActionView::Base.debug_rjs+:
<ruby>
ActionView::Base.debug_rjs = true
</ruby>
+It is enabled by default in development mode, and disabled in the rest.
+
TIP: For more information on debugging JavaScript, refer to "Firebug":http://getfirebug.com/, the popular debugger for Firefox.
h3. The Logger

0 comments on commit 4b21dfe

Please sign in to comment.