diff --git a/guides/source/action_cable_overview.md b/guides/source/action_cable_overview.md index f695c2a24a..9f7cf121ed 100644 --- a/guides/source/action_cable_overview.md +++ b/guides/source/action_cable_overview.md @@ -836,7 +836,7 @@ You can use `ActionCable.createConsumer()` to connect to the cable server if `action_cable_meta_tag` is invoked in the layout. Otherwise, A path is specified as first argument to `createConsumer` (e.g. `ActionCable.createConsumer("/websocket")`). -For every instance of your server, you create and for every worker your server +For every instance of your server you create, and for every worker your server spawns, you will also have a new instance of Action Cable, but the Redis or PostgreSQL adapter keeps messages synced across connections. diff --git a/guides/source/active_record_migrations.md b/guides/source/active_record_migrations.md index 4dd3dc9318..0ff99e74a8 100644 --- a/guides/source/active_record_migrations.md +++ b/guides/source/active_record_migrations.md @@ -251,7 +251,7 @@ class AddUserRefToProducts < ActiveRecord::Migration[7.1] end ``` -This migration will create a `user_id` column, [references](#references) are a +This migration will create a `user_id` column. [References](#references) are a shorthand for creating columns, indexes, foreign keys or even polymorphic association columns. @@ -556,7 +556,7 @@ If the `from_table` column name cannot be derived from the `to_table` name, you can use the `:column` option. Use the `:primary_key` option if the referenced primary key is not `:id`. -For example add a foreign key on `articles.reviewer` referencing `authors.email`: +For example, to add a foreign key on `articles.reviewer` referencing `authors.email`: ```ruby add_foreign_key :articles, :authors, column: :reviewer, primary_key: :email diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index 1c3c024b2f..d680dbac45 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -3788,7 +3788,7 @@ t.advance(seconds: 1) # => Sun Mar 28 03:00:00 +0200 2010 ``` -* If [`since`][Time#since] or [`ago`][Time#ago] jump to a time that can't be expressed with `Time` a `DateTime` object is returned instead. +* If [`since`][Time#since] or [`ago`][Time#ago] jumps to a time that can't be expressed with `Time` a `DateTime` object is returned instead. [Time#ago]: https://api.rubyonrails.org/classes/Time.html#method-i-ago [Time#change]: https://api.rubyonrails.org/classes/Time.html#method-i-change diff --git a/guides/source/api_app.md b/guides/source/api_app.md index a3ff00b25f..a643144091 100644 --- a/guides/source/api_app.md +++ b/guides/source/api_app.md @@ -156,7 +156,7 @@ This will do three main things for you: If you want to take an existing application and make it an API one, read the following steps. -In `config/application.rb` add the following line at the top of the `Application` +In `config/application.rb`, add the following line at the top of the `Application` class definition: ```ruby diff --git a/guides/source/caching_with_rails.md b/guides/source/caching_with_rails.md index 54c5309158..31dde87b69 100644 --- a/guides/source/caching_with_rails.md +++ b/guides/source/caching_with_rails.md @@ -299,7 +299,7 @@ NOTE: Notice that in this example we used the `cache_key_with_version` method, s Consider this example, which stores a list of Active Record objects representing superusers in the cache: ```ruby - # super_admins is an expensive SQL query, so don't run it too often +# super_admins is an expensive SQL query, so don't run it too often Rails.cache.fetch("super_admin_users", expires_in: 12.hours) do User.super_admins.to_a end @@ -312,7 +312,7 @@ cache stores that reload code when you make changes. Instead, cache the ID or some other primitive data type. For example: ```ruby - # super_admins is an expensive SQL query, so don't run it too often +# super_admins is an expensive SQL query, so don't run it too often ids = Rails.cache.fetch("super_admin_user_ids", expires_in: 12.hours) do User.super_admins.pluck(:id) end diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 26c3de7259..24f2e6796e 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -319,7 +319,7 @@ Configures lookup path for encrypted credentials. Configures lookup path for encryption key. -#### `secret_key_base`` +#### `secret_key_base` Is used for specifying a key which allows sessions for the application to be verified against a known secure key to prevent tampering. Applications get a random generated key in test and development environments, other environments should set one in `config/credentials.yml.enc`. @@ -369,7 +369,7 @@ Defines the CSS compressor to use. It is set by default by `sass-rails`. The uni #### `config.assets.js_compressor` -Defines the JavaScript compressor to use. Possible values are `:terser`, `:closure`, `:uglifier` and `:yui` which require the use of the `terser`, `closure-compiler`, `uglifier` or `yui-compressor` gems respectively. +Defines the JavaScript compressor to use. Possible values are `:terser`, `:closure`, `:uglifier` and `:yui`, which require the use of the `terser`, `closure-compiler`, `uglifier` or `yui-compressor` gems respectively. #### `config.assets.gzip` @@ -1884,7 +1884,7 @@ The default value depends on the `config.load_defaults` target version: Specifies what serializer the `MessageEncryptor` class will use by default. -Options are `:json`, `:hybrid` and `:marshal`. `:hybrid` uses the `JsonWithMarshalFallback` class. +Options are `:json`, `:hybrid` and `:marshal`. `:hybrid` uses the `JsonWithMarshalFallback` class. The default value depends on the `config.load_defaults` target version: @@ -2776,7 +2776,7 @@ Below is a comprehensive list of all the initializers found in Rails in the orde * `engines_blank_point`: Provides a point-in-initialization to hook into if you wish to do anything before engines are loaded. After this point, all railtie and engine initializers are run. -* `add_generator_templates`: Finds templates for generators at `lib/templates` for the application, railties, and engines and adds these to the `config.generators.templates` setting, which will make the templates available for all generators to reference. +* `add_generator_templates`: Finds templates for generators at `lib/templates` for the application, railties, and engines, and adds these to the `config.generators.templates` setting, which will make the templates available for all generators to reference. * `ensure_autoload_once_paths_as_subset`: Ensures that the `config.autoload_once_paths` only contains paths from `config.autoload_paths`. If it contains extra paths, then an exception will be raised. diff --git a/guides/source/debugging_rails_applications.md b/guides/source/debugging_rails_applications.md index 48db4b0511..4e6b88b480 100644 --- a/guides/source/debugging_rails_applications.md +++ b/guides/source/debugging_rails_applications.md @@ -308,7 +308,7 @@ Please check its [documentation](https://github.com/ruby/debug) for usage. By default, a debugging session will start after the `debug` library is required, which happens when your app boots. But don't worry, the session won't interfere your program. - To enter the debugging session, you can use `binding.break` and its aliases: `binding.b` and `debugger`. The following examples will use `debugger`: +To enter the debugging session, you can use `binding.break` and its aliases: `binding.b` and `debugger`. The following examples will use `debugger`: ```rb class PostsController < ApplicationController diff --git a/guides/source/form_helpers.md b/guides/source/form_helpers.md index 2d94a917e1..20e1ed0f29 100644 --- a/guides/source/form_helpers.md +++ b/guides/source/form_helpers.md @@ -809,7 +809,7 @@ Let's say we want to render a form with a set of fields for each of a person's a <% end %> ``` -Assuming the person had two addresses, with ids 23 and 45 this would create output similar to this: +Assuming the person had two addresses with ids 23 and 45, this would create output similar to this: ```html