aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/README.md
diff options
context:
space:
mode:
authorYoshiyuki Hirano <yhirano@me.com>2017-09-17 10:06:47 +0900
committerYoshiyuki Hirano <yhirano@me.com>2017-09-17 21:00:23 +0900
commit7d14bda3a7c74ec0262fa021e641a4235f5405d5 (patch)
treef81a86e9e66a51ab41fd53d71daca443a31c4de1 /activestorage/README.md
parentbf206dc2fc66f844c561329ca2fd9c0418d3ff90 (diff)
downloadrails-7d14bda3a7c74ec0262fa021e641a4235f5405d5.tar.gz
rails-7d14bda3a7c74ec0262fa021e641a4235f5405d5.tar.bz2
rails-7d14bda3a7c74ec0262fa021e641a4235f5405d5.zip
Fix file missing in activestorage's example code [ci skip]
* File.open("~/face.jpg") raise error: `Errno::ENOENT: No such file or directory @ rb_sysopen - ~/face.jpg`
Diffstat (limited to 'activestorage/README.md')
-rw-r--r--activestorage/README.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/activestorage/README.md b/activestorage/README.md
index 17d98978bb..f4aae4fc00 100644
--- a/activestorage/README.md
+++ b/activestorage/README.md
@@ -24,7 +24,7 @@ class User < ApplicationRecord
end
# Attach an avatar to the user.
-user.avatar.attach(io: File.open("~/face.jpg"), filename: "avatar.jpg", content_type: "image/jpg")
+user.avatar.attach(io: File.open("/path/to/face.jpg"), filename: "face.jpg", content_type: "image/jpg")
# Does the user have an avatar?
user.avatar.attached? # => true