diff options
author | Xavier Noria <fxn@hashref.com> | 2010-11-10 23:46:00 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-11-10 23:46:00 +0100 |
commit | c577e90f61b060164589e7112838e461c42bfe29 (patch) | |
tree | 4cb0e10da58d353de07d79be383819c86558af98 /railties/guides/source/api_documentation_guidelines.textile | |
parent | 7a2be37592a13aaf557619336a54da9092950b18 (diff) | |
download | rails-c577e90f61b060164589e7112838e461c42bfe29.tar.gz rails-c577e90f61b060164589e7112838e461c42bfe29.tar.bz2 rails-c577e90f61b060164589e7112838e461c42bfe29.zip |
restores the example for fixed-width font in API guidelines
Diffstat (limited to 'railties/guides/source/api_documentation_guidelines.textile')
-rw-r--r-- | railties/guides/source/api_documentation_guidelines.textile | 10 |
1 files changed, 10 insertions, 0 deletions
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 ++...++ for fixed-width font only works with *words*; that is: anything matching <tt>\A\w+\z</tt>. For anything else use +<tt>...</tt>+, notably symbols, setters, inline snippets, etc: h4. Regular Font |