aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/debugging_rails_applications.md
diff options
context:
space:
mode:
Diffstat (limited to 'guides/source/debugging_rails_applications.md')
-rw-r--r--guides/source/debugging_rails_applications.md51
1 files changed, 50 insertions, 1 deletions
diff --git a/guides/source/debugging_rails_applications.md b/guides/source/debugging_rails_applications.md
index f6e7980fe2..926a048762 100644
--- a/guides/source/debugging_rails_applications.md
+++ b/guides/source/debugging_rails_applications.md
@@ -242,6 +242,55 @@ The contents of the block, and therefore the string interpolation, is only
evaluated if debug is enabled. This performance savings is only really
noticeable with large amounts of logging, but it's a good practice to employ.
+
+Debugging with the `web-console` gem
+-------------------------------------
+
+The web console allows you to start an interactive Ruby session in your browser.
+An interactive console is launched automatically in case of an error but can also
+be launched for debugging purposes by invoking `console` in a view or controller.
+
+For example in a view:
+
+```ruby
+# new.html.erb
+<%= console %>
+```
+
+Or in a controller:
+
+```ruby
+# posts_controller.rb
+class PostsController < ApplicationController
+ def new
+ console
+ @post = Post.new
+ end
+end
+```
+
+### config.web_console.whitelisted_ips
+
+By default the web console can only be accessed from localhost.
+`config.web_console.whitelisted_ips` lets you control which IPs have access to
+the console.
+
+For example, to allow access from both localhost and 192.168.0.100, you can put
+inside your configuration file:
+
+```ruby
+config.web_console.whitelisted_ips = %w( 127.0.0.1 192.168.0.100 )
+```
+
+Or to allow access from an entire network:
+
+```ruby
+config.web_console.whitelisted_ips = %w( 127.0.0.1 192.168.0.0/16 )
+```
+
+The web console is a powerful tool so be careful when you give access to an IP.
+
+
Debugging with the `byebug` gem
---------------------------------
@@ -832,7 +881,7 @@ application. Here is a list of useful plugins for debugging:
* [Footnotes](https://github.com/josevalim/rails-footnotes) Every Rails page has
footnotes that give request information and link back to your source via
TextMate.
-* [Query Trace](https://github.com/ntalbott/query_trace/tree/master) Adds query
+* [Query Trace](https://github.com/ruckus/active-record-query-trace/tree/master) Adds query
origin tracing to your logs.
* [Query Reviewer](https://github.com/nesquena/query_reviewer) This rails plugin
not only runs "EXPLAIN" before each of your select queries in development, but