aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/active_storage_overview.md22
-rw-r--r--guides/source/upgrading_ruby_on_rails.md2
2 files changed, 15 insertions, 9 deletions
diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md
index 65d4e2934f..51f50e8931 100644
--- a/guides/source/active_storage_overview.md
+++ b/guides/source/active_storage_overview.md
@@ -742,16 +742,22 @@ during the test are complete and you won't receive an error from Active Storage
saying it can't find a file.
```ruby
+module RemoveUploadedFiles
+ def after_teardown
+ super
+ remove_uploaded_files
+ end
+
+ private
+
+ def remove_uploaded_files
+ FileUtils.rm_rf(Rails.root.join('tmp', 'storage'))
+ end
+end
+
module ActionDispatch
class IntegrationTest
- def remove_uploaded_files
- FileUtils.rm_rf(Rails.root.join('tmp', 'storage'))
- end
-
- def after_teardown
- super
- remove_uploaded_files
- end
+ prepend RemoveUploadedFiles
end
end
```
diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md
index a0553c1ccc..e74985c5b0 100644
--- a/guides/source/upgrading_ruby_on_rails.md
+++ b/guides/source/upgrading_ruby_on_rails.md
@@ -407,7 +407,7 @@ want to add this feature it will need to be turned on in an initializer.
Rails 5 now supports per-form CSRF tokens to mitigate against code-injection attacks with forms
created by JavaScript. With this option turned on, forms in your application will each have their
-own CSRF token that is specified to the action and method for that form.
+own CSRF token that is specific to the action and method for that form.
config.action_controller.per_form_csrf_tokens = true