Flowdock
method

attach

Importance_1
v5.2.3 - Show latest stable - 0 notes - Class: One
attach(attachable) public

Associates a given attachment with the current record, saving it to the database.

person.avatar.attach(params[:avatar]) # ActionDispatch::Http::UploadedFile object
person.avatar.attach(params[:signed_blob_id]) # Signed reference to blob from direct upload
person.avatar.attach(io: File.open("/path/to/face.jpg"), filename: "face.jpg", content_type: "image/jpg")
person.avatar.attach(avatar_blob) # ActiveStorage::Blob object
Show source
Register or log in to add new notes.