From c577e90f61b060164589e7112838e461c42bfe29 Mon Sep 17 00:00:00 2001
From: Xavier Noria <fxn@hashref.com>
Date: Wed, 10 Nov 2010 23:46:00 +0100
Subject: restores the example for fixed-width font in API guidelines

---
 railties/guides/source/api_documentation_guidelines.textile | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'railties/guides/source/api_documentation_guidelines.textile')

diff --git a/railties/guides/source/api_documentation_guidelines.textile b/railties/guides/source/api_documentation_guidelines.textile
index 523fbd8a77..e3ccd6396c 100644
--- a/railties/guides/source/api_documentation_guidelines.textile
+++ b/railties/guides/source/api_documentation_guidelines.textile
@@ -115,6 +115,16 @@ Use fixed-width fonts for:
 * method parameters
 * file names
 
+<ruby>
+class Array
+  # Calls <tt>to_param</tt> on all its elements and joins the result with
+  # slashes. This is used by <tt>url_for</tt> in Action Pack.
+  def to_param
+    collect { |e| e.to_param }.join '/'
+  end
+end
+</ruby>
+
 WARNING: Using a pair of +&#43;...&#43;+ for fixed-width font only works with *words*; that is: anything matching <tt>\A\w&#43;\z</tt>. For anything else  use +&lt;tt&gt;...&lt;/tt&gt;+, notably symbols, setters, inline snippets, etc:
 
 h4. Regular Font
-- 
cgit v1.2.3

