Skip to content

Commit 40cd784

Browse files
committed
Updates for profiling with Rails.
1 parent 1dc5848 commit 40cd784

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,11 +434,13 @@ <h2><a id="profiling-rails"> Profiling Rails</a></h2>
434434
<span class="ruby-keyword">end</span>
435435
</pre> </li>
436436
<li>
437-
<p>Add the ruby prof rack adapter to your middleware stack. One way
438-
to do this is by adding the following code to <code>config.ru</code>:</p>
437+
<p>Add the ruby prof rack adapter to your middleware stack. The
438+
Rails <a href="https://guides.rubyonrails.org/configuring.html#configuring-middleware"
439+
title="Configure Middleware">documentation</a> describes several
440+
ways to do this. One way is to add the following code to <code>application.rb</code>:</p>
439441
<pre class="ruby"><span class="ruby-keyword">if</span> <span class="ruby-constant">Rails</span>.<span
440442
class="ruby-identifier">env</span>.<span class="ruby-identifier">profile?</span>
441-
<span class="ruby-identifier">use</span> <span class="ruby-constant">Rack</span><span
443+
<code class="ruby plain">config.middleware.use</code> <span class="ruby-constant">Rack</span><span
442444
class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span>, <span
443445
class="ruby-value">:path</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-string">'./tmp/profile'</span>
444446
<span class="ruby-keyword">end</span>

0 commit comments

Comments
 (0)