Fix typos in API docs [ci-skip]

This commit is contained in:
Jonathan Hefner 2023-01-01 10:51:33 -06:00
parent 33557c5dca
commit 3eadf057db
11 changed files with 33 additions and 33 deletions

@ -722,7 +722,7 @@ def headers(args = nil)
# mail.attachments['filename.jpg'] = File.read('/path/to/filename.jpg')
#
# If you do this, then Mail will take the file name and work out the mime type.
# It will also set the Content-Type, Content-Disposition, Content-Transfer-Encoding
# It will also set the Content-Type, Content-Disposition, and Content-Transfer-Encoding,
# and encode the contents of the attachment in Base64.
#
# You can also specify overrides if you want by passing a hash instead of a string:

@ -18,7 +18,7 @@ module Rendering
extend ActiveSupport::Concern
include ActionView::ViewPaths
# Normalizes arguments, options and then delegates render_to_body and
# Normalizes arguments and options, and then delegates to render_to_body and
# sticks the result in <tt>self.response_body</tt>.
def render(*args, &block)
options = _normalize_render(*args, &block)
@ -35,7 +35,7 @@ def render(*args, &block)
# Raw rendering of a template to a string.
#
# It is similar to render, except that it does not
# set the +response_body+ and it should be guaranteed
# set the +response_body+, and it should be guaranteed
# to always return a string.
#
# If a component extends the semantics of +response_body+

@ -33,7 +33,7 @@ def etag(&etagger)
end
end
# Sets the +etag+, +last_modified+, or both on the response and renders a
# Sets the +etag+, +last_modified+, or both on the response, and renders a
# <tt>304 Not Modified</tt> response if the request is already fresh.
#
# === Parameters:
@ -55,9 +55,9 @@ def etag(&etagger)
# * <tt>:last_modified</tt> Sets a "weak" last-update validator on the
# response. Subsequent requests that set If-Modified-Since may return a
# 304 Not Modified response if last_modified <= If-Modified-Since.
# * <tt>:public</tt> By default the Cache-Control header is private, set this to
# * <tt>:public</tt> By default the Cache-Control header is private. Set this to
# +true+ if you want your application to be cacheable by other devices (proxy caches).
# * <tt>:cache_control</tt> When given will overwrite an existing Cache-Control header.
# * <tt>:cache_control</tt> When given, will overwrite an existing Cache-Control header.
# See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities.
# * <tt>:template</tt> By default, the template digest for the current
# controller/action is included in ETags. If the action renders a
@ -73,9 +73,9 @@ def etag(&etagger)
# end
#
# This will render the show template if the request isn't sending a matching ETag or
# If-Modified-Since header and just a <tt>304 Not Modified</tt> response if there's a match.
# If-Modified-Since header, and just a <tt>304 Not Modified</tt> response if there's a match.
#
# You can also just pass a record. In this case +last_modified+ will be set
# You can also just pass a record. In this case, +last_modified+ will be set
# by calling +updated_at+ and +etag+ by passing the object itself.
#
# def show
@ -84,7 +84,7 @@ def etag(&etagger)
# end
#
# You can also pass an object that responds to +maximum+, such as a
# collection of active records. In this case +last_modified+ will be set by
# collection of active records. In this case, +last_modified+ will be set by
# calling <tt>maximum(:updated_at)</tt> on the collection (the timestamp of the
# most recently updated record) and the +etag+ by passing the object itself.
#
@ -107,7 +107,7 @@ def etag(&etagger)
# fresh_when(@article, public: true, cache_control: { no_cache: true })
# end
#
# This will set in the response Cache-Control = public, no-cache.
# This will set in the response Cache-Control: public, no-cache.
#
# When rendering a different template than the default controller/action
# style, you can indicate which digest to include in the ETag:
@ -137,7 +137,7 @@ def fresh_when(object = nil, etag: nil, weak_etag: nil, strong_etag: nil, last_m
# Sets the +etag+ and/or +last_modified+ on the response and checks it against
# the client request. If the request doesn't match the options provided, the
# request is considered stale and should be generated from scratch. Otherwise,
# it's fresh and we don't need to generate anything and a reply of <tt>304 Not Modified</tt> is sent.
# it's fresh, and we don't need to generate anything, and a reply of <tt>304 Not Modified</tt> is sent.
#
# === Parameters:
#
@ -158,9 +158,9 @@ def fresh_when(object = nil, etag: nil, weak_etag: nil, strong_etag: nil, last_m
# * <tt>:last_modified</tt> Sets a "weak" last-update validator on the
# response. Subsequent requests that set If-Modified-Since may return a
# 304 Not Modified response if last_modified <= If-Modified-Since.
# * <tt>:public</tt> By default the Cache-Control header is private, set this to
# * <tt>:public</tt> By default the Cache-Control header is private. Set this to
# +true+ if you want your application to be cacheable by other devices (proxy caches).
# * <tt>:cache_control</tt> When given will overwrite an existing Cache-Control header.
# * <tt>:cache_control</tt> When given, will overwrite an existing Cache-Control header.
# See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities.
# * <tt>:template</tt> By default, the template digest for the current
# controller/action is included in ETags. If the action renders a
@ -181,7 +181,7 @@ def fresh_when(object = nil, etag: nil, weak_etag: nil, strong_etag: nil, last_m
# end
# end
#
# You can also just pass a record. In this case +last_modified+ will be set
# You can also just pass a record. In this case, +last_modified+ will be set
# by calling +updated_at+ and +etag+ by passing the object itself.
#
# def show
@ -196,7 +196,7 @@ def fresh_when(object = nil, etag: nil, weak_etag: nil, strong_etag: nil, last_m
# end
#
# You can also pass an object that responds to +maximum+, such as a
# collection of active records. In this case +last_modified+ will be set by
# collection of active records. In this case, +last_modified+ will be set by
# calling <tt>maximum(:updated_at)</tt> on the collection (the timestamp of the
# most recently updated record) and the +etag+ by passing the object itself.
#
@ -237,7 +237,7 @@ def fresh_when(object = nil, etag: nil, weak_etag: nil, strong_etag: nil, last_m
# end
# end
#
# This will set in the response Cache-Control = public, no-cache.
# This will set in the response Cache-Control: public, no-cache.
#
# When rendering a different template than the default controller/action
# style, you can indicate which digest to include in the ETag:
@ -261,13 +261,13 @@ def stale?(object = nil, **freshness_kwargs)
# This method will overwrite an existing Cache-Control header.
# See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities.
#
# HTTP Cache-Control Extensions for Stale Content. See https://tools.ietf.org/html/rfc5861
# HTTP Cache-Control Extensions for Stale Content. See https://tools.ietf.org/html/rfc5861.
# It helps to cache an asset and serve it while is being revalidated and/or returning with an error.
#
# expires_in 3.hours, public: true, stale_while_revalidate: 60.seconds
# expires_in 3.hours, public: true, stale_while_revalidate: 60.seconds, stale_if_error: 5.minutes
#
# HTTP Cache-Control Extensions other values: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
# HTTP Cache-Control Extensions other values: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control.
# Any additional key-value pairs are concatenated onto the Cache-Control header in the response:
#
# expires_in 3.hours, public: true, "s-maxage": 3.hours, "no-transform": true

@ -112,12 +112,12 @@ def strong_etag=(strong_validators)
def etag?; etag; end
# True if an ETag is set and it's a weak validator (preceded with W/)
# True if an ETag is set, and it's a weak validator (preceded with W/).
def weak_etag?
etag? && etag.start_with?('W/"')
end
# True if an ETag is set and it isn't a weak validator (not preceded with W/)
# True if an ETag is set, and it isn't a weak validator (not preceded with W/).
def strong_etag?
etag? && !weak_etag?
end

@ -41,7 +41,7 @@ module AssetTagHelper
# When the Asset Pipeline is enabled, you can pass the name of your manifest as
# source, and include other JavaScript or CoffeeScript files inside the manifest.
#
# If the server supports Early Hints header links for these assets will be
# If the server supports Early Hints, header links for these assets will be
# automatically pushed.
#
# ==== Options
@ -130,7 +130,7 @@ def javascript_include_tag(*sources)
# set <tt>extname: false</tt> in the options.
# You can modify the link attributes by passing a hash as the last argument.
#
# If the server supports Early Hints header links for these assets will be
# If the server supports Early Hints, header links for these assets will be
# automatically pushed.
#
# ==== Options

@ -17,7 +17,7 @@ module CsrfHelper
# You don't need to use these tags for regular forms as they generate their own hidden fields.
#
# For Ajax requests other than GETs, extract the "csrf-token" from the meta-tag and send as the
# "X-CSRF-Token" HTTP header. If you are using rails-ujs this happens automatically.
# "X-CSRF-Token" HTTP header. If you are using rails-ujs, this happens automatically.
#
def csrf_meta_tags
if defined?(protect_against_forgery?) && protect_against_forgery?

@ -96,7 +96,7 @@ module ClassMethods
# Example:
#
# validates :password, presence: true, confirmation: true, if: :password_required?
# validates :token, length: {is: 24}, strict: TokenLengthException
# validates :token, length: { is: 24 }, strict: TokenLengthException
#
#
# Finally, the options +:if+, +:unless+, +:on+, +:allow_blank+, +:allow_nil+, +:strict+

@ -70,7 +70,7 @@ module ActiveRecord
#
# The stored attribute names can be retrieved using {.stored_attributes}[rdoc-ref:rdoc-ref:ClassMethods#stored_attributes].
#
# User.stored_attributes[:settings] # [:color, :homepage, :two_factor_auth, :login_retry]
# User.stored_attributes[:settings] # => [:color, :homepage, :two_factor_auth, :login_retry]
#
# == Overwriting default accessors
#

@ -83,11 +83,11 @@ class Object
# end
# end
#
# # styled.link_to "I'm red", "/"
# # #=> <a href="/" style="color: red;">I'm red</a>
# styled.link_to "I'm red", "/"
# # => <a href="/" style="color: red;">I'm red</a>
#
# # styled.button_tag "I'm red too!"
# # #=> <button style="color: red;">I'm red too!</button>
# styled.button_tag "I'm red too!"
# # => <button style="color: red;">I'm red too!</button>
#
def with_options(options, &block)
option_merger = ActiveSupport::OptionMerger.new(self, options)

@ -5,7 +5,7 @@ class Deprecation
module Disallowed
# Sets the criteria used to identify deprecation messages which should be
# disallowed. Can be an array containing strings, symbols, or regular
# expressions. (Symbols are treated as strings). These are compared against
# expressions. (Symbols are treated as strings.) These are compared against
# the text of the generated deprecation warning.
#
# Additionally the scalar symbol +:all+ may be used to treat all
@ -13,7 +13,7 @@ module Disallowed
#
# Deprecations matching a substring or regular expression will be handled
# using the configured +ActiveSupport::Deprecation.disallowed_behavior+
# rather than +ActiveSupport::Deprecation.behavior+
# rather than +ActiveSupport::Deprecation.behavior+.
attr_writer :disallowed_warnings
# Returns the configured criteria used to identify deprecation messages

@ -206,8 +206,8 @@ def tableize(class_name)
end
# Creates a class name from a plural table name like Rails does for table
# names to models. Note that this returns a string and not a Class (To
# convert to an actual class follow +classify+ with #constantize).
# names to models. Note that this returns a string and not a Class. (To
# convert to an actual class follow +classify+ with #constantize.)
#
# classify('ham_and_eggs') # => "HamAndEgg"
# classify('posts') # => "Post"