I'm a Ruby on Rails and React Native enthusiast with over four years of experience creating innovative software solutions. I work well in teams and am always up for challenging projects. I enjoy playing chess and gaming in my free time.
1 minute read
The ActiveStorage::Blob#compose
method allows us to combine more than one Active Storage blobs into a single,
unified blob.
This method is helpful when we create composite files
(for example, integrating an audio track with its lyrics)
or generating integrated documents from multiple components.
ActiveStorage Compose Method
Rails 7.2,
adds
a new parameter key that allows us to have custom key,
similar to other Blob API’s
Example
Here’s a code example demonstrating how to pass the custom key to the
compose
method: