From 285690143ea80fe504385a409cdc28f0d9b7ada2 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Tue, 17 Aug 2010 13:19:00 +0200 Subject: debugging guide: revises the section on debugging RJS --- railties/guides/source/debugging_rails_applications.textile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'railties') diff --git a/railties/guides/source/debugging_rails_applications.textile b/railties/guides/source/debugging_rails_applications.textile index 07c6f6b65d..35069f33ad 100644 --- a/railties/guides/source/debugging_rails_applications.textile +++ b/railties/guides/source/debugging_rails_applications.textile @@ -96,21 +96,23 @@ Will be rendered as follows: Title: Rails debugging guide -h4. Debugging JavaScript +h4. Debugging RJS -Rails has built-in support to debug RJS. To enable it, add the following in the +Rails::Initializer do |config|+ block inside +environment.rb+: +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. + +The flag to enable RJS debugging in your configuration files is +config.action_view.debug_rjs+: -config.action_view[:debug_rjs] = true +config.action_view.debug_rjs = true -Or, at any time, set +ActionView::Base.debug_rjs+ to true: +or at any time setting +ActionView::Base.debug_rjs+: ActionView::Base.debug_rjs = 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). +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. -- cgit v1.2.3