If you want to attach a file you generated on disk or downloaded from a user-submitted URL, you can do it like this.
@model.image.attach(
io: File.open('/path/to/file'),
filename: 'file.pdf',
# content type is optional
content_type: 'application/pdf'
)
From us to your inbox weekly.