aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
Diffstat (limited to 'guides')
-rw-r--r--guides/assets/stylesheets/main.css6
-rw-r--r--guides/rails_guides/levenshtein.rb4
-rw-r--r--guides/source/action_mailer_basics.md15
-rw-r--r--guides/source/active_record_querying.md10
-rw-r--r--guides/source/active_storage_overview.md2
-rw-r--r--guides/source/development_dependencies_install.md14
6 files changed, 30 insertions, 21 deletions
diff --git a/guides/assets/stylesheets/main.css b/guides/assets/stylesheets/main.css
index cd355b1d1a..2657a84a91 100644
--- a/guides/assets/stylesheets/main.css
+++ b/guides/assets/stylesheets/main.css
@@ -283,8 +283,12 @@ body {
#header .wrapper, #topNav .wrapper, #feature .wrapper {padding-left: 1em; max-width: 960px;}
#feature .wrapper {max-width: 640px; padding-right: 23em; position: relative; z-index: 0;}
+@media screen and (max-width: 960px) {
+ #container .wrapper { padding-right: 23em; }
+}
+
@media screen and (max-width: 800px) {
- #feature .wrapper { padding-right: 0; }
+ #feature .wrapper, #container .wrapper { padding-right: 0; }
}
/* Links
diff --git a/guides/rails_guides/levenshtein.rb b/guides/rails_guides/levenshtein.rb
index c48af797fa..2213ef754d 100644
--- a/guides/rails_guides/levenshtein.rb
+++ b/guides/rails_guides/levenshtein.rb
@@ -12,8 +12,8 @@ module RailsGuides
n = s.length
m = t.length
- return m if (0 == n)
- return n if (0 == m)
+ return m if 0 == n
+ return n if 0 == m
d = (0..m).to_a
x = nil
diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md
index 6c5f03ab38..37cbf3f53d 100644
--- a/guides/source/action_mailer_basics.md
+++ b/guides/source/action_mailer_basics.md
@@ -422,6 +422,21 @@ use the rendered text for the text part. The render command is the same one used
inside of Action Controller, so you can use all the same options, such as
`:text`, `:inline` etc.
+If you would like to render a template located outside of the default `app/views/mailer_name/` directory, you can apply the `prepend_view_path`, like so:
+
+```ruby
+class UserMailer < ApplicationMailer
+ prepend_view_path "custom/path/to/mailer/view"
+
+ # This will try to load "custom/path/to/mailer/view/welcome_email" template
+ def welcome_email
+ # ...
+ end
+end
+```
+
+You can also consider using the [append_view_path](https://guides.rubyonrails.org/action_view_overview.html#view-paths) method.
+
#### Caching mailer view
You can perform fragment caching in mailer views like in application views using the `cache` method.
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md
index a2890b9b7a..91cc175095 100644
--- a/guides/source/active_record_querying.md
+++ b/guides/source/active_record_querying.md
@@ -1277,16 +1277,6 @@ class Article < ApplicationRecord
end
```
-This is exactly the same as defining a class method, and which you use is a matter of personal preference:
-
-```ruby
-class Article < ApplicationRecord
- def self.published
- where(published: true)
- end
-end
-```
-
Scopes are also chainable within scopes:
```ruby
diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md
index 6933717c2b..1c15d075b9 100644
--- a/guides/source/active_storage_overview.md
+++ b/guides/source/active_storage_overview.md
@@ -174,7 +174,7 @@ google:
Add the [`google-cloud-storage`](https://github.com/GoogleCloudPlatform/google-cloud-ruby/tree/master/google-cloud-storage) gem to your `Gemfile`:
```ruby
-gem "google-cloud-storage", "~> 1.8", require: false
+gem "google-cloud-storage", "~> 1.11", require: false
```
### Mirror Service
diff --git a/guides/source/development_dependencies_install.md b/guides/source/development_dependencies_install.md
index 7a414f21fe..439797ddcb 100644
--- a/guides/source/development_dependencies_install.md
+++ b/guides/source/development_dependencies_install.md
@@ -350,31 +350,31 @@ prerequisite for installing this package manager is that
On macOS, you can run:
```bash
-brew install yarn
+$ brew install yarn
```
On Ubuntu, you can run:
```bash
-curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
-echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
+$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
+$ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
-sudo apt-get update && sudo apt-get install yarn
+$ sudo apt-get update && sudo apt-get install yarn
```
On Fedora or CentOS, just run:
```bash
-sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo
+$ sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo
-sudo yum install yarn
+$ sudo yum install yarn
```
Finally, after installing Yarn, you will need to run the following
command inside of the `activestorage` directory to install the dependencies:
```bash
-yarn install
+$ yarn install
```
Extracting previews, tested in Active Storage's test suite requires third-party