Skip to content

Commit 0ea82ee

Browse files
authored
Merge pull request rails#42519 from ashiksp/update-storage-references
[ci skip]Updated the has_many_attached references in the examples.
2 parents fe1cb68 + d4b2136 commit 0ea82ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

guides/source/active_storage_overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,22 +486,22 @@ model test. To do that, provide a Hash containing at least an open IO object
486486
and a filename:
487487

488488
```ruby
489-
@message.image.attach(io: File.open('/path/to/file'), filename: 'file.pdf')
489+
@message.images.attach(io: File.open('/path/to/file'), filename: 'file.pdf')
490490
```
491491

492492
When possible, provide a content type as well. Active Storage attempts to
493493
determine a file’s content type from its data. It falls back to the content
494494
type you provide if it can’t do that.
495495

496496
```ruby
497-
@message.image.attach(io: File.open('/path/to/file'), filename: 'file.pdf', content_type: 'application/pdf')
497+
@message.images.attach(io: File.open('/path/to/file'), filename: 'file.pdf', content_type: 'application/pdf')
498498
```
499499

500500
You can bypass the content type inference from the data by passing in
501501
`identify: false` along with the `content_type`.
502502

503503
```ruby
504-
@message.image.attach(
504+
@message.images.attach(
505505
io: File.open('/path/to/file'),
506506
filename: 'file.pdf',
507507
content_type: 'application/pdf',

0 commit comments

Comments
 (0)