Skip to content

Commit

Permalink
Capitalize headings to match style guidelines
Browse files Browse the repository at this point in the history
Fix all headings to follow Rails Guides Guidelines
  • Loading branch information
missy-davies committed Oct 18, 2022
1 parent d54f0c5 commit d49a3ab
Show file tree
Hide file tree
Showing 41 changed files with 150 additions and 150 deletions.
2 changes: 1 addition & 1 deletion guides/source/action_cable_overview.md
Expand Up @@ -792,7 +792,7 @@ connections as you have workers. The default worker pool size is set to 4, so
that means you have to make at least 4 database connections available.
You can change that in `config/database.yml` through the `pool` attribute.
### Client-side logging
### Client-side Logging
Client-side logging is disabled by default. You can enable this by setting the `ActionCable.logger.enabled` to true.
Expand Down
6 changes: 3 additions & 3 deletions guides/source/action_controller_overview.md
Expand Up @@ -142,7 +142,7 @@ When this form is submitted, the value of `params[:client]` will be `{ "name" =>

The `params` object acts like a Hash, but lets you use symbols and strings interchangeably as keys.

### JSON parameters
### JSON Parameters

If you're writing a web service application, you might find yourself more comfortable accepting parameters in JSON format. If the "Content-Type" header of your request is set to "application/json", Rails will automatically load your parameters into the `params` hash, which you can access as you would normally.

Expand Down Expand Up @@ -680,7 +680,7 @@ If you use the cookie session store, this would apply to the `session` and

[`cookies`]: https://api.rubyonrails.org/classes/ActionController/Cookies.html#method-i-cookies

Rendering XML and JSON data
Rendering XML and JSON Data
---------------------------

ActionController makes it extremely easy to render `XML` or `JSON` data. If you've generated a controller using scaffolding, it would look something like this:
Expand Down Expand Up @@ -1274,7 +1274,7 @@ NOTE: Certain exceptions are only rescuable from the `ApplicationController` cla

[`rescue_from`]: https://api.rubyonrails.org/classes/ActiveSupport/Rescuable/ClassMethods.html#method-i-rescue_from

Force HTTPS protocol
Force HTTPS Protocol
--------------------

If you'd like to ensure that communication to your controller is only possible
Expand Down
4 changes: 2 additions & 2 deletions guides/source/action_mailbox_basics.md
Expand Up @@ -340,15 +340,15 @@ your job queue being able to hold jobs for that long.)

[`config.action_mailbox.incinerate_after`]: configuring.html#config-action-mailbox-incinerate-after

## Working with Action Mailbox in development
## Working with Action Mailbox in Development

It's helpful to be able to test incoming emails in development without actually
sending and receiving real emails. To accomplish this, there's a conductor
controller mounted at `/rails/conductor/action_mailbox/inbound_emails`,
which gives you an index of all the InboundEmails in the system, their
state of processing, and a form to create a new InboundEmail as well.

## Testing mailboxes
## Testing Mailboxes

Example:

Expand Down
12 changes: 6 additions & 6 deletions guides/source/action_mailer_basics.md
Expand Up @@ -22,7 +22,7 @@ What is Action Mailer?
Action Mailer allows you to send emails from your application using mailer classes
and views.

### Mailers are similar to controllers
### Mailers are Similar to Controllers

They inherit from [`ActionMailer::Base`][] and live in `app/mailers`. Mailers also work
very similarly to controllers. Some examples of similarities are enumerated below.
Expand Down Expand Up @@ -259,7 +259,7 @@ access it with the [`message`][] method on the `ActionMailer::MessageDelivery` o
[`message`]: https://api.rubyonrails.org/classes/ActionMailer/MessageDelivery.html#method-i-message
[`with`]: https://api.rubyonrails.org/classes/ActionMailer/Parameterized/ClassMethods.html#method-i-with

### Auto encoding header values
### Auto Encoding Header Values

Action Mailer handles the auto encoding of multibyte characters inside of
headers and bodies.
Expand Down Expand Up @@ -352,7 +352,7 @@ Action Mailer 3.0 makes inline attachments, which involved a lot of hacking in p
<%= image_tag attachments['image.jpg'].url, alt: 'My Photo', class: 'photos' %>
```

#### Sending Email To Multiple Recipients
#### Sending Email to Multiple Recipients

It is possible to send email to one or more recipients in one email (e.g.,
informing all admins of a new signup) by setting the list of emails to the `:to`
Expand All @@ -374,7 +374,7 @@ end
The same format can be used to set carbon copy (Cc:) and blind carbon copy
(Bcc:) recipients, by using the `:cc` and `:bcc` keys respectively.

#### Sending Email With Name
#### Sending Email with Name

Sometimes you wish to show the name of the person instead of just their email
address when they receive the email. You can use [`email_address_with_name`][] for
Expand Down Expand Up @@ -473,7 +473,7 @@ You can also consider using the [`append_view_path`][] method.
[`append_view_path`]: https://api.rubyonrails.org/classes/ActionView/ViewPaths/ClassMethods.html#method-i-append_view_path
[`prepend_view_path`]: https://api.rubyonrails.org/classes/ActionView/ViewPaths/ClassMethods.html#method-i-prepend_view_path

#### Caching mailer view
#### Caching Mailer View

You can perform fragment caching in mailer views like in application views using the [`cache`][] method.

Expand Down Expand Up @@ -625,7 +625,7 @@ NOTE: non-`GET` links require [rails-ujs](https://github.com/rails/rails/blob/ma
[jQuery UJS](https://github.com/rails/jquery-ujs), and won't work in mailer templates.
They will result in normal `GET` requests.

### Adding images in Action Mailer Views
### Adding Images in Action Mailer Views

Unlike controllers, the mailer instance doesn't have any context about the
incoming request so you'll need to provide the `:asset_host` parameter yourself.
Expand Down
10 changes: 5 additions & 5 deletions guides/source/action_text_overview.md
Expand Up @@ -25,7 +25,7 @@ RichText model that's associated with any existing Active Record model in the ap
Any embedded images (or other attachments) are automatically stored using
Active Storage and associated with the included RichText model.

## Trix compared to other rich text editors
## Trix Compared to Other Rich Text Editors

Most WYSIWYG editors are wrappers around HTML’s `contenteditable` and `execCommand` APIs,
designed by Microsoft to support live editing of web pages in Internet Explorer 5.5,
Expand Down Expand Up @@ -61,7 +61,7 @@ After the installation is complete, a Rails app should have the following change

2. The `trix` stylesheet will be included together with Action Text styles in your `application.css` file.

## Creating Rich Text content
## Creating Rich Text Content

Add a rich text field to an existing model:

Expand Down Expand Up @@ -111,7 +111,7 @@ end

[`rich_text_area`]: https://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-rich_text_area

## Rendering Rich Text content
## Rendering Rich Text Content

By default, Action Text will render rich text content inside an element with the
`.trix-content` class:
Expand Down Expand Up @@ -214,7 +214,7 @@ By default, all `ActiveRecord::Base` descendants mix-in

[global-id]: https://github.com/rails/globalid#usage

## Avoid N+1 queries
## Avoid N+1 Queries

If you wish to preload the dependent `ActionText::RichText` model, assuming your rich text field is named `content`, you can use the named scope:

Expand All @@ -223,7 +223,7 @@ Message.all.with_rich_text_content # Preload the body without attachments.
Message.all.with_rich_text_content_and_embeds # Preload both body and attachments.
```

## API / Backend development
## API / Backend Development

1. A backend API (for example, using JSON) needs a separate endpoint for uploading files that creates an `ActiveStorage::Blob` and returns its `attachable_sgid`:

Expand Down
2 changes: 1 addition & 1 deletion guides/source/action_view_helpers.md
Expand Up @@ -12,7 +12,7 @@ After reading this guide, you will know:

--------------------------------------------------------------------------------

Overview of helpers provided by Action View
Overview of Helpers Provided by Action View
-------------------------------------------

WIP: Not all the helpers are listed here. For a full list see the [API documentation](https://api.rubyonrails.org/classes/ActionView/Helpers.html)
Expand Down
10 changes: 5 additions & 5 deletions guides/source/action_view_overview.md
Expand Up @@ -204,7 +204,7 @@ This will render a file named `_menu.html.erb` at that point within the view tha

That code will pull in the partial from `app/views/shared/_menu.html.erb`.

#### Using Partials to simplify Views
#### Using Partials to Simplify Views

One way to use partials is to treat them as the equivalent of subroutines; a way to move details out of a view so that you can grasp what's going on more easily. For example, you might have a view that looks like this:

Expand All @@ -223,7 +223,7 @@ One way to use partials is to treat them as the equivalent of subroutines; a way

Here, the `_ad_banner.html.erb` and `_footer.html.erb` partials could contain content that is shared among many pages in your application. You don't need to see the details of these sections when you're concentrating on a particular page.

#### `render` without `partial` and `locals` options
#### `render` without `partial` and `locals` Options

In the above example, `render` takes 2 options: `partial` and `locals`. But if
these are the only options you want to pass, you can skip using these options.
Expand All @@ -239,7 +239,7 @@ You can also do:
<%= render "product", product: @product %>
```

#### The `as` and `object` options
#### The `as` and `object` Options

By default `ActionView::Partials::PartialRenderer` has its object in a local variable with the same name as the template. So, given:

Expand Down Expand Up @@ -398,7 +398,7 @@ views are located. By default, it only looks inside the `app/views` directory.
We can add other locations and give them certain precedence when resolving
paths using the `prepend_view_path` and `append_view_path` methods.

### Prepend view path
### Prepend View Path

This can be helpful for example when we want to put views inside a different
directory for subdomains.
Expand All @@ -411,7 +411,7 @@ prepend_view_path "app/views/#{request.subdomain}"

Then Action View will look first in this directory when resolving views.

### Append view path
### Append View Path

Similarly, we can append paths:

Expand Down
6 changes: 3 additions & 3 deletions guides/source/active_job_basics.md
Expand Up @@ -326,7 +326,7 @@ class ApplicationJob < ActiveJob::Base
end
```

### Available callbacks
### Available Callbacks

* [`before_enqueue`][]
* [`around_enqueue`][]
Expand Down Expand Up @@ -377,7 +377,7 @@ UserMailer.welcome(@user).deliver_later # Email will be localized to Esperanto.
```


Supported types for arguments
Supported Types for Arguments
----------------------------

ActiveJob supports the following types of arguments by default:
Expand Down Expand Up @@ -496,7 +496,7 @@ If an exception from a job is not rescued, then the job is referred to as "faile

[`rescue_from`]: https://api.rubyonrails.org/classes/ActiveSupport/Rescuable/ClassMethods.html#method-i-rescue_from

### Retrying or Discarding failed jobs
### Retrying or Discarding Failed Jobs

A failed job will not be retried, unless configured otherwise.

Expand Down
4 changes: 2 additions & 2 deletions guides/source/active_model_basics.md
Expand Up @@ -203,7 +203,7 @@ class Person
end
```

#### Querying object directly for its list of all changed attributes.
#### Querying an Object Directly for its List of All Changed Attributes

```irb
irb> person = Person.new
Expand Down Expand Up @@ -231,7 +231,7 @@ irb> person.changes
=> {"first_name"=>[nil, "First Name"]}
```

#### Attribute-based accessor methods
#### Attribute-based Accessor Methods

Track whether the particular attribute has been changed or not.

Expand Down
2 changes: 1 addition & 1 deletion guides/source/active_record_encryption.md
Expand Up @@ -66,7 +66,7 @@ But, under the hood, the executed SQL looks like this:
INSERT INTO `articles` (`title`) VALUES ('{\"p\":\"n7J0/ol+a7DRMeaE\",\"h\":{\"iv\":\"DXZMDWUKfp3bg/Yu\",\"at\":\"X1/YjMHbHD4talgF9dt61A==\"}}')
```

#### Important: About storage and column size
#### Important: About Storage and Column Size

Encryption requires extra space because of Base64 encoding and the metadata stored along with the encrypted payloads. When using the built-in envelope encryption key provider, you can estimate the worst-case overhead at around 255 bytes. This overhead is negligible at larger sizes. Not only because it gets diluted but because the library uses compression by default, which can offer up to 30% storage savings over the unencrypted version for larger payloads.

Expand Down
12 changes: 6 additions & 6 deletions guides/source/active_record_multiple_databases.md
Expand Up @@ -32,7 +32,7 @@ The following features are not (yet) supported:

* Load balancing replicas

## Setting up your application
## Setting up Your Application

While Rails tries to do most of the work for you there are still some steps you'll
need to do to get your application ready for multiple databases.
Expand Down Expand Up @@ -274,7 +274,7 @@ $ bin/rails generate scaffold Dog name:string --database animals --parent Animal
This will skip generating `AnimalsRecord` since you've indicated to Rails that you want to
use a different parent class.

## Activating automatic role switching
## Activating Automatic Role Switching

Finally, in order to use the read-only replica in your application, you'll need to activate
the middleware for automatic switching.
Expand Down Expand Up @@ -332,7 +332,7 @@ config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelec
config.active_record.database_resolver_context = MyCookieResolver
```

## Using manual connection switching
## Using Manual Connection Switching

There are some cases where you may want your application to connect to a writer or a replica
and the automatic connection switching isn't adequate. For example, you may know that for a
Expand Down Expand Up @@ -367,7 +367,7 @@ ActiveRecord::Base.connected_to(role: :reading, prevent_writes: true) do
end
```

## Horizontal sharding
## Horizontal Sharding

Horizontal sharding is when you split up your database to reduce the number of rows on each
database server, but maintain the same schema across "shards". This is commonly called "multi-tenant"
Expand Down Expand Up @@ -432,7 +432,7 @@ ActiveRecord::Base.connected_to(role: :reading, shard: :shard_one) do
end
```

## Activating automatic shard switching
## Activating Automatic Shard Switching

Applications are able to automatically switch shards per request using the provided
middleware.
Expand Down Expand Up @@ -515,7 +515,7 @@ end
`ActiveRecord::Base.connected_to` maintains the ability to switch
connections globally.

### Handling associations with joins across databases
### Handling Associations with Joins across Databases

As of Rails 7.0+, Active Record has an option for handling associations that would perform
a join across multiple databases. If you have a has many through or a has one through association
Expand Down
2 changes: 1 addition & 1 deletion guides/source/active_record_postgresql.md
Expand Up @@ -672,7 +672,7 @@ irb> Article.count
NOTE: This application only cares about non-archived `Articles`. A view also
allows for conditions so we can exclude the archived `Articles` directly.

Structure dumps
Structure Dumps
--------------

If your `config.active_record.schema_format` is `:sql`, Rails will call `pg_dump` to generate a
Expand Down
14 changes: 7 additions & 7 deletions guides/source/active_record_querying.md
Expand Up @@ -899,7 +899,7 @@ FROM orders
GROUP BY created_at
```

### Total of grouped items
### Total of Grouped Items

To get the total of grouped items on a single query, call [`count`][] after the `group`.

Expand Down Expand Up @@ -1604,7 +1604,7 @@ end

[`scope`]: https://api.rubyonrails.org/classes/ActiveRecord/Scoping/Named/ClassMethods.html#method-i-scope

### Passing in arguments
### Passing in Arguments

Your scope can take arguments:

Expand Down Expand Up @@ -1636,7 +1636,7 @@ These methods will still be accessible on the association objects:
irb> author.books.costs_more_than(100.10)
```

### Using conditionals
### Using Conditionals

Your scope can utilize conditionals:

Expand All @@ -1658,7 +1658,7 @@ end

However, there is one important caveat: A scope will always return an `ActiveRecord::Relation` object, even if the conditional evaluates to `false`, whereas a class method, will return `nil`. This can cause `NoMethodError` when chaining class methods with conditionals, if any of the conditionals return `false`.

### Applying a default scope
### Applying a Default Scope

If we wish for a scope to be applied across all queries to the model we can use the
[`default_scope`][] method within the model itself.
Expand Down Expand Up @@ -1720,7 +1720,7 @@ irb> Book.new

[`default_scope`]: https://api.rubyonrails.org/classes/ActiveRecord/Scoping/Default/ClassMethods.html#method-i-default_scope

### Merging of scopes
### Merging of Scopes

Just like `where` clauses, scopes are merged using `AND` conditions.

Expand Down Expand Up @@ -1895,7 +1895,7 @@ There are some examples below. This guide won't cover all the possibilities, jus
When an Active Record method is called, the query is not immediately generated and sent to the database.
The query is sent only when the data is actually needed. So each example below generates a single query.

### Retrieving filtered data from multiple tables
### Retrieving Filtered Data from Multiple Tables

```ruby
Customer
Expand All @@ -1914,7 +1914,7 @@ INNER JOIN reviews
WHERE (reviews.created_at > '2019-01-08')
```

### Retrieving specific data from multiple tables
### Retrieving Specific Data from Multiple Tables

```ruby
Book
Expand Down

0 comments on commit d49a3ab

Please sign in to comment.