mirror of https://github.com/rails/rails
Standardize on using hyphens rather than colons to separate option names from their explanation in documentation. Replace + with tt tags. Closes #8732. [ryanb]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8106 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
19d4c212cd
commit
94502623fb
|
@ -6,10 +6,10 @@ module ActionController
|
||||||
module ResponseAssertions
|
module ResponseAssertions
|
||||||
# Asserts that the response is one of the following types:
|
# Asserts that the response is one of the following types:
|
||||||
#
|
#
|
||||||
# * <tt>:success</tt>: Status code was 200
|
# * <tt>:success</tt> - Status code was 200
|
||||||
# * <tt>:redirect</tt>: Status code was in the 300-399 range
|
# * <tt>:redirect</tt> - Status code was in the 300-399 range
|
||||||
# * <tt>:missing</tt>: Status code was 404
|
# * <tt>:missing</tt> - Status code was 404
|
||||||
# * <tt>:error</tt>: Status code was in the 500-599 range
|
# * <tt>:error</tt> - Status code was in the 500-599 range
|
||||||
#
|
#
|
||||||
# You can also pass an explicit status number like assert_response(501)
|
# You can also pass an explicit status number like assert_response(501)
|
||||||
# or its symbolic equivalent assert_response(:not_implemented).
|
# or its symbolic equivalent assert_response(:not_implemented).
|
||||||
|
|
|
@ -326,14 +326,16 @@ module ActionController
|
||||||
# that update or insert an element with that identifier.
|
# that update or insert an element with that identifier.
|
||||||
#
|
#
|
||||||
# Use the first argument to narrow down assertions to only statements
|
# Use the first argument to narrow down assertions to only statements
|
||||||
# of that type. Possible values are +:replace+, +:replace_html+, +:show+,
|
# of that type. Possible values are <tt>:replace</tt>, <tt>:replace_html</tt>,
|
||||||
# +:hide+, +:toggle+, +:remove+ and +:insert_html+.
|
# <tt>:show</tt>, <tt>:hide</tt>, <tt>:toggle</tt>, <tt>:remove</tt> and
|
||||||
|
# <tt>:insert_html</tt>.
|
||||||
#
|
#
|
||||||
# Use the argument +:insert+ followed by an insertion position to narrow
|
# Use the argument <tt>:insert</tt> followed by an insertion position to narrow
|
||||||
# down the assertion to only statements that insert elements in that
|
# down the assertion to only statements that insert elements in that
|
||||||
# position. Possible values are +:top+, +:bottom+, +:before+ and +:after+.
|
# position. Possible values are <tt>:top</tt>, <tt>:bottom</tt>, <tt>:before</tt>
|
||||||
|
# and <tt>:after</tt>.
|
||||||
#
|
#
|
||||||
# Using the +:remove+ statement, you will be able to pass a block, but it will
|
# Using the <tt>:remove</tt> statement, you will be able to pass a block, but it will
|
||||||
# be ignored as there is no HTML passed for this statement.
|
# be ignored as there is no HTML passed for this statement.
|
||||||
#
|
#
|
||||||
# === Using blocks
|
# === Using blocks
|
||||||
|
|
|
@ -982,11 +982,11 @@ module ActionController #:nodoc:
|
||||||
|
|
||||||
# Redirects the browser to the target specified in +options+. This parameter can take one of three forms:
|
# Redirects the browser to the target specified in +options+. This parameter can take one of three forms:
|
||||||
#
|
#
|
||||||
# * <tt>Hash</tt>: The URL will be generated by calling url_for with the +options+.
|
# * <tt>Hash</tt> - The URL will be generated by calling url_for with the +options+.
|
||||||
# * <tt>Record</tt>: The URL will be generated by calling url_for with the +options+, which will reference a named URL for that record.
|
# * <tt>Record</tt> - The URL will be generated by calling url_for with the +options+, which will reference a named URL for that record.
|
||||||
# * <tt>String starting with protocol:// (like http://)</tt>: Is passed straight through as the target for redirection.
|
# * <tt>String starting with protocol:// (like http://)</tt> - Is passed straight through as the target for redirection.
|
||||||
# * <tt>String not containing a protocol</tt>: The current protocol and host is prepended to the string.
|
# * <tt>String not containing a protocol</tt> - The current protocol and host is prepended to the string.
|
||||||
# * <tt>:back</tt>: Back to the page that issued the request. Useful for forms that are triggered from multiple places.
|
# * <tt>:back</tt> - Back to the page that issued the request. Useful for forms that are triggered from multiple places.
|
||||||
# Short-hand for redirect_to(request.env["HTTP_REFERER"])
|
# Short-hand for redirect_to(request.env["HTTP_REFERER"])
|
||||||
#
|
#
|
||||||
# Examples:
|
# Examples:
|
||||||
|
|
|
@ -42,32 +42,32 @@ module ActionController #:nodoc:
|
||||||
# the user is redirected to a different action. The +options+ parameter
|
# the user is redirected to a different action. The +options+ parameter
|
||||||
# is a hash consisting of the following key/value pairs:
|
# is a hash consisting of the following key/value pairs:
|
||||||
#
|
#
|
||||||
# * <tt>:params</tt>: a single key or an array of keys that must
|
# * <tt>:params</tt> - a single key or an array of keys that must
|
||||||
# be in the <tt>params</tt> hash in order for the action(s) to be safely
|
# be in the <tt>params</tt> hash in order for the action(s) to be safely
|
||||||
# called.
|
# called.
|
||||||
# * <tt>:session</tt>: a single key or an array of keys that must
|
# * <tt>:session</tt> - a single key or an array of keys that must
|
||||||
# be in the <tt>session</tt> in order for the action(s) to be safely called.
|
# be in the <tt>session</tt> in order for the action(s) to be safely called.
|
||||||
# * <tt>:flash</tt>: a single key or an array of keys that must
|
# * <tt>:flash</tt> - a single key or an array of keys that must
|
||||||
# be in the flash in order for the action(s) to be safely called.
|
# be in the flash in order for the action(s) to be safely called.
|
||||||
# * <tt>:method</tt>: a single key or an array of keys--any one of which
|
# * <tt>:method</tt> - a single key or an array of keys--any one of which
|
||||||
# must match the current request method in order for the action(s) to
|
# must match the current request method in order for the action(s) to
|
||||||
# be safely called. (The key should be a symbol: <tt>:get</tt> or
|
# be safely called. (The key should be a symbol: <tt>:get</tt> or
|
||||||
# <tt>:post</tt>, for example.)
|
# <tt>:post</tt>, for example.)
|
||||||
# * <tt>:xhr</tt>: true/false option to ensure that the request is coming
|
# * <tt>:xhr</tt> - true/false option to ensure that the request is coming
|
||||||
# from an Ajax call or not.
|
# from an Ajax call or not.
|
||||||
# * <tt>:add_flash</tt>: a hash of name/value pairs that should be merged
|
# * <tt>:add_flash</tt> - a hash of name/value pairs that should be merged
|
||||||
# into the session's flash if the prerequisites cannot be satisfied.
|
# into the session's flash if the prerequisites cannot be satisfied.
|
||||||
# * <tt>:add_headers</tt>: a hash of name/value pairs that should be
|
# * <tt>:add_headers</tt> - a hash of name/value pairs that should be
|
||||||
# merged into the response's headers hash if the prerequisites cannot
|
# merged into the response's headers hash if the prerequisites cannot
|
||||||
# be satisfied.
|
# be satisfied.
|
||||||
# * <tt>:redirect_to</tt>: the redirection parameters to be used when
|
# * <tt>:redirect_to</tt> - the redirection parameters to be used when
|
||||||
# redirecting if the prerequisites cannot be satisfied. You can
|
# redirecting if the prerequisites cannot be satisfied. You can
|
||||||
# redirect either to named route or to the action in some controller.
|
# redirect either to named route or to the action in some controller.
|
||||||
# * <tt>:render</tt>: the render parameters to be used when
|
# * <tt>:render</tt> - the render parameters to be used when
|
||||||
# the prerequisites cannot be satisfied.
|
# the prerequisites cannot be satisfied.
|
||||||
# * <tt>:only</tt>: only apply this verification to the actions specified
|
# * <tt>:only</tt> - only apply this verification to the actions specified
|
||||||
# in the associated array (may also be a single value).
|
# in the associated array (may also be a single value).
|
||||||
# * <tt>:except</tt>: do not apply this verification to the actions
|
# * <tt>:except</tt> - do not apply this verification to the actions
|
||||||
# specified in the associated array (may also be a single value).
|
# specified in the associated array (may also be a single value).
|
||||||
def verify(options={})
|
def verify(options={})
|
||||||
filter_opts = { :only => options[:only], :except => options[:except] }
|
filter_opts = { :only => options[:only], :except => options[:except] }
|
||||||
|
|
|
@ -38,7 +38,7 @@ module ActionView
|
||||||
# <tr id="foo_person_123" class="person">...
|
# <tr id="foo_person_123" class="person">...
|
||||||
#
|
#
|
||||||
# content_tag_for also accepts a hash of options, which will be converted to
|
# content_tag_for also accepts a hash of options, which will be converted to
|
||||||
# additional HTML attributes. If you specify a +:class+ value, it will be combined
|
# additional HTML attributes. If you specify a <tt>:class</tt> value, it will be combined
|
||||||
# with the default class name for your object. For example:
|
# with the default class name for your object. For example:
|
||||||
#
|
#
|
||||||
# <% content_tag_for(:li, @person, :class => "bar") %>...
|
# <% content_tag_for(:li, @person, :class => "bar") %>...
|
||||||
|
|
|
@ -97,14 +97,14 @@ module ActiveRecord
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# Options:
|
# Options:
|
||||||
# * <tt>:conditions</tt>: An SQL fragment like "administrator = 1" or [ "user_name = ?", username ]. See conditions in the intro.
|
# * <tt>:conditions</tt> - An SQL fragment like "administrator = 1" or [ "user_name = ?", username ]. See conditions in the intro.
|
||||||
# * <tt>:joins</tt>: An SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id". (Rarely needed).
|
# * <tt>:joins</tt> - An SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id". (Rarely needed).
|
||||||
# The records will be returned read-only since they will have attributes that do not correspond to the table's columns.
|
# The records will be returned read-only since they will have attributes that do not correspond to the table's columns.
|
||||||
# * <tt>:order</tt>: An SQL fragment like "created_at DESC, name" (really only used with GROUP BY calculations).
|
# * <tt>:order</tt> - An SQL fragment like "created_at DESC, name" (really only used with GROUP BY calculations).
|
||||||
# * <tt>:group</tt>: An attribute name by which the result should be grouped. Uses the GROUP BY SQL-clause.
|
# * <tt>:group</tt> - An attribute name by which the result should be grouped. Uses the GROUP BY SQL-clause.
|
||||||
# * <tt>:select</tt>: By default, this is * as in SELECT * FROM, but can be changed if you for example want to do a join, but not
|
# * <tt>:select</tt> - By default, this is * as in SELECT * FROM, but can be changed if you for example want to do a join, but not
|
||||||
# include the joined columns.
|
# include the joined columns.
|
||||||
# * <tt>:distinct</tt>: Set this to true to make this a distinct calculation, such as SELECT COUNT(DISTINCT posts.id) ...
|
# * <tt>:distinct</tt> - Set this to true to make this a distinct calculation, such as SELECT COUNT(DISTINCT posts.id) ...
|
||||||
#
|
#
|
||||||
# Examples:
|
# Examples:
|
||||||
# Person.calculate(:count, :all) # The same as Person.count
|
# Person.calculate(:count, :all) # The same as Person.count
|
||||||
|
|
|
@ -300,17 +300,17 @@ module ActiveRecord
|
||||||
# <tt>:date</tt>, <tt>:binary</tt>, <tt>:boolean</tt>.
|
# <tt>:date</tt>, <tt>:binary</tt>, <tt>:boolean</tt>.
|
||||||
#
|
#
|
||||||
# Available options are (none of these exists by default):
|
# Available options are (none of these exists by default):
|
||||||
# * <tt>:limit</tt>:
|
# * <tt>:limit</tt> -
|
||||||
# Requests a maximum column length (<tt>:string</tt>, <tt>:text</tt>,
|
# Requests a maximum column length (<tt>:string</tt>, <tt>:text</tt>,
|
||||||
# <tt>:binary</tt> or <tt>:integer</tt> columns only)
|
# <tt>:binary</tt> or <tt>:integer</tt> columns only)
|
||||||
# * <tt>:default</tt>:
|
# * <tt>:default</tt> -
|
||||||
# The column's default value. Use nil for NULL.
|
# The column's default value. Use nil for NULL.
|
||||||
# * <tt>:null</tt>:
|
# * <tt>:null</tt> -
|
||||||
# Allows or disallows +NULL+ values in the column. This option could
|
# Allows or disallows +NULL+ values in the column. This option could
|
||||||
# have been named <tt>:null_allowed</tt>.
|
# have been named <tt>:null_allowed</tt>.
|
||||||
# * <tt>:precision</tt>:
|
# * <tt>:precision</tt> -
|
||||||
# Specifies the precision for a <tt>:decimal</tt> column.
|
# Specifies the precision for a <tt>:decimal</tt> column.
|
||||||
# * <tt>:scale</tt>:
|
# * <tt>:scale</tt> -
|
||||||
# Specifies the scale for a <tt>:decimal</tt> column.
|
# Specifies the scale for a <tt>:decimal</tt> column.
|
||||||
#
|
#
|
||||||
# Please be aware of different RDBMS implementations behavior with
|
# Please be aware of different RDBMS implementations behavior with
|
||||||
|
|
|
@ -5,8 +5,8 @@ module ActiveSupport #:nodoc:
|
||||||
module Array #:nodoc:
|
module Array #:nodoc:
|
||||||
module Conversions
|
module Conversions
|
||||||
# Converts the array to comma-seperated sentence where the last element is joined by the connector word. Options:
|
# Converts the array to comma-seperated sentence where the last element is joined by the connector word. Options:
|
||||||
# * <tt>:connector</tt>: The word used to join the last element in arrays with two or more elements (default: "and")
|
# * <tt>:connector</tt> - The word used to join the last element in arrays with two or more elements (default: "and")
|
||||||
# * <tt>:skip_last_comma</tt>: Set to true to return "a, b and c" instead of "a, b, and c".
|
# * <tt>:skip_last_comma</tt> - Set to true to return "a, b and c" instead of "a, b, and c".
|
||||||
def to_sentence(options = {})
|
def to_sentence(options = {})
|
||||||
options.assert_valid_keys(:connector, :skip_last_comma)
|
options.assert_valid_keys(:connector, :skip_last_comma)
|
||||||
options.reverse_merge! :connector => 'and', :skip_last_comma => false
|
options.reverse_merge! :connector => 'and', :skip_last_comma => false
|
||||||
|
|
|
@ -283,8 +283,8 @@ module ActiveSupport::Multibyte::Handlers #:nodoc:
|
||||||
# Returns the KC normalization of the string by default. NFKC is considered the best normalization form for
|
# Returns the KC normalization of the string by default. NFKC is considered the best normalization form for
|
||||||
# passing strings to databases and validations.
|
# passing strings to databases and validations.
|
||||||
#
|
#
|
||||||
# * <tt>str</tt>: The string to perform normalization on.
|
# * <tt>str</tt> - The string to perform normalization on.
|
||||||
# * <tt>form</tt>: The form you want to normalize in. Should be one of the following: :c, :kc, :d or :kd.
|
# * <tt>form</tt> - The form you want to normalize in. Should be one of the following: :c, :kc, :d or :kd.
|
||||||
def normalize(str, form=ActiveSupport::Multibyte::DEFAULT_NORMALIZATION_FORM)
|
def normalize(str, form=ActiveSupport::Multibyte::DEFAULT_NORMALIZATION_FORM)
|
||||||
# See http://www.unicode.org/reports/tr15, Table 1
|
# See http://www.unicode.org/reports/tr15, Table 1
|
||||||
codepoints = u_unpack(str)
|
codepoints = u_unpack(str)
|
||||||
|
|
Loading…
Reference in New Issue