提交 c577e90f 编写于 作者: X Xavier Noria

restores the example for fixed-width font in API guidelines

上级 7a2be375
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册