I'm trying to rename a user uploaded file before saving in ActiveStorage and I don't seem to find any docs to do that. Hopefully someone has successfully done it and has code examples to share.
Thank you.
You can try the following method
@message.image.attach(io: File.open('/path/to/file'), filename: 'file.pdf')
in the official ActiveStorage documentation you can find more examples