mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
restores the example for fixed-width font in API guidelines
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user