mirror of https://github.com/rails/rails
[ci skip] switch eg. to proper e.g.
This commit is contained in:
parent
245b037734
commit
eca6c273fe
|
@ -560,7 +560,7 @@ module ActionDispatch
|
|||
# Constrains parameters with a hash of regular expressions
|
||||
# or an object that responds to <tt>matches?</tt>. In addition, constraints
|
||||
# other than path can also be specified with any object
|
||||
# that responds to <tt>===</tt> (eg. String, Array, Range, etc.).
|
||||
# that responds to <tt>===</tt> (e.g. String, Array, Range, etc.).
|
||||
#
|
||||
# match 'path/:id', constraints: { id: /[A-Z]\d{5}/ }, via: :get
|
||||
#
|
||||
|
|
|
@ -492,7 +492,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
|
|||
get "/projects/status(.:format)"
|
||||
end
|
||||
|
||||
# without dup, additional (and possibly unwanted) values will be present in the options (eg. :host)
|
||||
# without dup, additional (and possibly unwanted) values will be present in the options (e.g. :host)
|
||||
original_options = { controller: "projects", action: "status" }
|
||||
options = original_options.dup
|
||||
|
||||
|
|
|
@ -888,7 +888,7 @@ module ActionView
|
|||
#
|
||||
# Now, when you use a form element with the <tt>_destroy</tt> parameter,
|
||||
# with a value that evaluates to +true+, you will destroy the associated
|
||||
# model (eg. 1, '1', true, or 'true'):
|
||||
# model (e.g. 1, '1', true, or 'true'):
|
||||
#
|
||||
# <%= form_for @person do |person_form| %>
|
||||
# ...
|
||||
|
@ -977,7 +977,7 @@ module ActionView
|
|||
# This will allow you to specify which models to destroy in the
|
||||
# attributes hash by adding a form element for the <tt>_destroy</tt>
|
||||
# parameter with a value that evaluates to +true+
|
||||
# (eg. 1, '1', true, or 'true'):
|
||||
# (e.g. 1, '1', true, or 'true'):
|
||||
#
|
||||
# <%= form_for @person do |person_form| %>
|
||||
# ...
|
||||
|
@ -2038,7 +2038,7 @@ module ActionView
|
|||
#
|
||||
# Now, when you use a form element with the <tt>_destroy</tt> parameter,
|
||||
# with a value that evaluates to +true+, you will destroy the associated
|
||||
# model (eg. 1, '1', true, or 'true'):
|
||||
# model (e.g. 1, '1', true, or 'true'):
|
||||
#
|
||||
# <%= form_for @person do |person_form| %>
|
||||
# ...
|
||||
|
@ -2127,7 +2127,7 @@ module ActionView
|
|||
# This will allow you to specify which models to destroy in the
|
||||
# attributes hash by adding a form element for the <tt>_destroy</tt>
|
||||
# parameter with a value that evaluates to +true+
|
||||
# (eg. 1, '1', true, or 'true'):
|
||||
# (e.g. 1, '1', true, or 'true'):
|
||||
#
|
||||
# <%= form_for @person do |person_form| %>
|
||||
# ...
|
||||
|
|
|
@ -297,7 +297,7 @@ module ActionView
|
|||
end
|
||||
|
||||
# Pretty prints (formats and approximates) a number in a way it
|
||||
# is more readable by humans (eg.: 1200000000 becomes "1.2
|
||||
# is more readable by humans (e.g.: 1200000000 becomes "1.2
|
||||
# Billion"). This is useful for numbers that can get very large
|
||||
# (and too hard to read).
|
||||
#
|
||||
|
@ -305,7 +305,7 @@ module ActionView
|
|||
# size.
|
||||
#
|
||||
# You can also define your own unit-quantifier names if you want
|
||||
# to use other decimal units (eg.: 1500 becomes "1.5
|
||||
# to use other decimal units (e.g.: 1500 becomes "1.5
|
||||
# kilometers", 0.150 becomes "150 milliliters", etc). You may
|
||||
# define a wide range of unit quantifiers, even fractional ones
|
||||
# (centi, deci, mili, etc).
|
||||
|
|
|
@ -10,7 +10,7 @@ module ActiveJob
|
|||
# This reduces the cost of hosting on a service like Heroku along
|
||||
# with the memory footprint of having to maintain additional jobs if
|
||||
# hosting on a dedicated server. All queues can run within a
|
||||
# single application (eg. Rails, Sinatra, etc.) process.
|
||||
# single application (e.g. Rails, Sinatra, etc.) process.
|
||||
#
|
||||
# Read more about Sucker Punch {here}[https://github.com/brandonhilkert/sucker_punch].
|
||||
#
|
||||
|
|
|
@ -354,7 +354,7 @@ module ActiveRecord
|
|||
end
|
||||
|
||||
# Inserts the given fixture into the table. Overridden in adapters that require
|
||||
# something beyond a simple insert (eg. Oracle).
|
||||
# something beyond a simple insert (e.g. Oracle).
|
||||
# Most of adapters should implement `insert_fixtures_set` that leverages bulk SQL insert.
|
||||
# We keep this method to provide fallback
|
||||
# for databases like sqlite that do not support bulk inserts.
|
||||
|
|
|
@ -288,7 +288,7 @@ module ActiveRecord
|
|||
# [:allow_destroy]
|
||||
# If true, destroys any members from the attributes hash with a
|
||||
# <tt>_destroy</tt> key and a value that evaluates to +true+
|
||||
# (eg. 1, '1', true, or 'true'). This option is off by default.
|
||||
# (e.g. 1, '1', true, or 'true'). This option is off by default.
|
||||
# [:reject_if]
|
||||
# Allows you to specify a Proc or a Symbol pointing to a method
|
||||
# that checks whether a record should be built for a certain attribute
|
||||
|
|
|
@ -332,7 +332,7 @@ db_namespace = namespace :db do
|
|||
end
|
||||
|
||||
namespace :fixtures do
|
||||
desc "Loads fixtures into the current environment's database. Load specific fixtures using FIXTURES=x,y. Load from subdirectory in test/fixtures using FIXTURES_DIR=z. Specify an alternative path (eg. spec/fixtures) using FIXTURES_PATH=spec/fixtures."
|
||||
desc "Loads fixtures into the current environment's database. Load specific fixtures using FIXTURES=x,y. Load from subdirectory in test/fixtures using FIXTURES_DIR=z. Specify an alternative path (e.g. spec/fixtures) using FIXTURES_PATH=spec/fixtures."
|
||||
task load: :load_config do
|
||||
require "active_record/fixtures"
|
||||
|
||||
|
@ -354,7 +354,7 @@ db_namespace = namespace :db do
|
|||
ActiveRecord::FixtureSet.create_fixtures(fixtures_dir, fixture_files)
|
||||
end
|
||||
|
||||
# desc "Search for a fixture given a LABEL or ID. Specify an alternative path (eg. spec/fixtures) using FIXTURES_PATH=spec/fixtures."
|
||||
# desc "Search for a fixture given a LABEL or ID. Specify an alternative path (e.g. spec/fixtures) using FIXTURES_PATH=spec/fixtures."
|
||||
task identify: :load_config do
|
||||
require "active_record/fixtures"
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ module ActiveRecord
|
|||
)
|
||||
|
||||
# Ensure we aren't dealing with a subclass of String that might
|
||||
# override methods we use (eg. Arel::Nodes::SqlLiteral).
|
||||
# override methods we use (e.g. Arel::Nodes::SqlLiteral).
|
||||
if condition.first.kind_of?(String) && !condition.first.instance_of?(String)
|
||||
condition = [String.new(condition.first), *condition[1..-1]]
|
||||
end
|
||||
|
|
|
@ -23,7 +23,7 @@ module ActiveRecord
|
|||
# You can set custom coder to encode/decode your serialized attributes to/from different formats.
|
||||
# JSON, YAML, Marshal are supported out of the box. Generally it can be any wrapper that provides +load+ and +dump+.
|
||||
#
|
||||
# NOTE: If you are using structured database data types (eg. PostgreSQL +hstore+/+json+, or MySQL 5.7+
|
||||
# NOTE: If you are using structured database data types (e.g. PostgreSQL +hstore+/+json+, or MySQL 5.7+
|
||||
# +json+) there is no need for the serialization provided by {.store}[rdoc-ref:rdoc-ref:ClassMethods#store].
|
||||
# Simply use {.store_accessor}[rdoc-ref:ClassMethods#store_accessor] instead to generate
|
||||
# the accessor methods. Be aware that these columns use a string keyed hash and do not allow access
|
||||
|
|
|
@ -47,7 +47,7 @@ en:
|
|||
# If set to true, precision will mean the number of significant digits instead
|
||||
# of the number of decimal digits (1234 with precision 2 becomes 1200, 1.23543 becomes 1.2)
|
||||
significant: false
|
||||
# If set, the zeros after the decimal separator will always be stripped (eg.: 1.200 will be 1.2)
|
||||
# If set, the zeros after the decimal separator will always be stripped (e.g.: 1.200 will be 1.2)
|
||||
strip_insignificant_zeros: false
|
||||
|
||||
# Used in NumberHelper.number_to_currency()
|
||||
|
|
|
@ -270,7 +270,7 @@ module ActiveSupport
|
|||
end
|
||||
|
||||
# Pretty prints (formats and approximates) a number in a way it
|
||||
# is more readable by humans (eg.: 1200000000 becomes "1.2
|
||||
# is more readable by humans (e.g.: 1200000000 becomes "1.2
|
||||
# Billion"). This is useful for numbers that can get very large
|
||||
# (and too hard to read).
|
||||
#
|
||||
|
@ -278,7 +278,7 @@ module ActiveSupport
|
|||
# size.
|
||||
#
|
||||
# You can also define your own unit-quantifier names if you want
|
||||
# to use other decimal units (eg.: 1500 becomes "1.5
|
||||
# to use other decimal units (e.g.: 1500 becomes "1.5
|
||||
# kilometers", 0.150 becomes "150 milliliters", etc). You may
|
||||
# define a wide range of unit quantifiers, even fractional ones
|
||||
# (centi, deci, mili, etc).
|
||||
|
|
|
@ -30,7 +30,7 @@ module ActiveSupport
|
|||
# If set to true, precision will mean the number of significant digits instead
|
||||
# of the number of decimal digits (1234 with precision 2 becomes 1200, 1.23543 becomes 1.2)
|
||||
significant: false,
|
||||
# If set, the zeros after the decimal separator will always be stripped (eg.: 1.200 will be 1.2)
|
||||
# If set, the zeros after the decimal separator will always be stripped (e.g.: 1.200 will be 1.2)
|
||||
strip_insignificant_zeros: false
|
||||
},
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ module ActiveSupport
|
|||
|
||||
pattern = prepare_pattern(event)
|
||||
|
||||
# Don't add multiple subscribers (eg. if methods are redefined).
|
||||
# Don't add multiple subscribers (e.g. if methods are redefined).
|
||||
return if pattern_subscribed?(pattern)
|
||||
|
||||
subscriber.patterns[pattern] = notifier.subscribe(pattern, subscriber)
|
||||
|
|
|
@ -346,8 +346,8 @@ Please refer to the [Changelog][action-pack] for detailed changes.
|
|||
names instead.
|
||||
([commit](https://github.com/rails/rails/commit/83b767ce))
|
||||
|
||||
* Deprecated accessing mime types via constants (eg. `Mime::HTML`). Use the
|
||||
subscript operator with a symbol instead (eg. `Mime[:html]`).
|
||||
* Deprecated accessing mime types via constants (e.g. `Mime::HTML`). Use the
|
||||
subscript operator with a symbol instead (e.g. `Mime[:html]`).
|
||||
([Pull Request](https://github.com/rails/rails/pull/21869))
|
||||
|
||||
* Deprecated `redirect_to :back` in favor of `redirect_back`, which accepts a
|
||||
|
|
|
@ -453,7 +453,7 @@ class GuestsCleanupJob < ApplicationJob
|
|||
end
|
||||
```
|
||||
|
||||
If the exception is not rescued within the job, eg. as shown above, then the job is referred to as "failed".
|
||||
If the exception is not rescued within the job, e.g. as shown above, then the job is referred to as "failed".
|
||||
|
||||
### Retrying or Discarding failed jobs
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ The full set of methods that can be used in this block are as follows:
|
|||
or not. Defaults to `true`.
|
||||
* `scaffold_controller` different from `resource_controller`, defines which generator to use for generating a _scaffolded_ controller when using `rails generate scaffold`. Defaults to `:scaffold_controller`.
|
||||
* `stylesheets` turns on the hook for stylesheets in generators. Used in Rails for when the `scaffold` generator is run, but this hook can be used in other generates as well. Defaults to `true`.
|
||||
* `stylesheet_engine` configures the stylesheet engine (for eg. sass) to be used when generating assets. Defaults to `:css`.
|
||||
* `stylesheet_engine` configures the stylesheet engine (for e.g. sass) to be used when generating assets. Defaults to `:css`.
|
||||
* `scaffold_stylesheet` creates `scaffold.css` when generating a scaffolded resource. Defaults to `true`.
|
||||
* `test_framework` defines which test framework to use. Defaults to `false` and will use minitest by default.
|
||||
* `template_engine` defines which template engine to use, such as ERB or Haml. Defaults to `:erb`.
|
||||
|
@ -1200,7 +1200,7 @@ That environment is no different than the default ones, start a server with `rai
|
|||
### Deploy to a subdirectory (relative URL root)
|
||||
|
||||
By default Rails expects that your application is running at the root
|
||||
(eg. `/`). This section explains how to run your application inside a directory.
|
||||
(e.g. `/`). This section explains how to run your application inside a directory.
|
||||
|
||||
Let's assume we want to deploy our application to "/app1". Rails needs to know
|
||||
this directory to generate the appropriate routes:
|
||||
|
|
|
@ -153,7 +153,7 @@ We are happy to have people volunteer to translate the Rails guides. Just follow
|
|||
|
||||
Note that translations are not submitted to the Rails repository. As detailed above, your work happens in a fork. This is so because in practice documentation maintenance via patches is only sustainable in English.
|
||||
|
||||
To generate the guides in HTML format cd into the *guides* directory then run (eg. for it-IT):
|
||||
To generate the guides in HTML format cd into the *guides* directory then run (e.g. for it-IT):
|
||||
|
||||
```bash
|
||||
$ bundle install
|
||||
|
|
|
@ -963,7 +963,7 @@ end
|
|||
```
|
||||
|
||||
If the hash of attributes for an object contains the key `_destroy` with a value that
|
||||
evaluates to `true` (eg. 1, '1', true, or 'true') then the object will be destroyed.
|
||||
evaluates to `true` (e.g. 1, '1', true, or 'true') then the object will be destroyed.
|
||||
This form allows users to remove addresses:
|
||||
|
||||
```erb
|
||||
|
|
|
@ -955,7 +955,7 @@ resources :user_permissions, controller: 'admin/user_permissions'
|
|||
This will route to the `Admin::UserPermissions` controller.
|
||||
|
||||
NOTE: Only the directory notation is supported. Specifying the
|
||||
controller with Ruby constant notation (eg. `controller: 'Admin::UserPermissions'`)
|
||||
controller with Ruby constant notation (e.g. `controller: 'Admin::UserPermissions'`)
|
||||
can lead to routing problems and results in
|
||||
a warning.
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ By default, guides that have not been modified are not processed, so `ONLY` is r
|
|||
|
||||
To force processing all the guides, pass `ALL=1`.
|
||||
|
||||
If you want to generate guides in a language other than English, you can keep them in a separate directory under `source` (eg. `source/es`) and use the `GUIDES_LANGUAGE` environment variable:
|
||||
If you want to generate guides in a language other than English, you can keep them in a separate directory under `source` (e.g. `source/es`) and use the `GUIDES_LANGUAGE` environment variable:
|
||||
|
||||
```
|
||||
bundle exec rake guides:generate GUIDES_LANGUAGE=es
|
||||
|
|
|
@ -34,7 +34,7 @@ module Rails
|
|||
end
|
||||
|
||||
# This method creates nested route entry for namespaced resources.
|
||||
# For eg. rails g controller foo/bar/baz index show
|
||||
# For e.g. rails g controller foo/bar/baz index show
|
||||
# Will generate -
|
||||
# namespace :foo do
|
||||
# namespace :bar do
|
||||
|
|
Loading…
Reference in New Issue