[RUBY] About Active Storage

Introduction

As a memo, it is difficult to establish knowledge about ActiveStorage. .. It would be helpful if you could point out any mistakes.

About Active Storage

ActiveStorage is a gem that comes standard with Ruby on Rails, and by using it, you can use methods that make it easy to upload image files, etc., and you can easily create a table to save images. There is.

To use Active Storage

To use ActiveStorage, you need to install the following. -ImageMagick (command line image conversion tool) -> Install from Homebrew because it's software, not Gem ・ Mini magick (Gem for using ImageMagick's function on Rails) ・ Image processing (Gem for adjusting image size that cannot be done with mini magic k) -> For the above two, execute bundle install after describing in GemFile

Don't forget to do it

ActiveStorage related migration is created by executing the following in the application directory you want to execute

% rails active_storage:install
% rails db:migrate

Finally

I think that ActiveStorage is very convenient and there are many opportunities to use it when it becomes available, so I would like to use it a lot so that I can learn it!

Recommended Posts

About Active Storage
About DelegationError (Active Storage)
[Beginner] About Active Storage
Introduce Active Storage
[Rails] About active hash
Active Storage Initialization Manual
gem active_hash About active hash
About =
Post videos with Active Storage
Move Active Storage on S3 locally
[Rails] How to use Active Storage
Unit tests under Active Storage deployment
About method.invoke
About Kotlin
About attr_accessor
About Hinemos
About inheritance
About params
About Docker
About form_for
About Spring ③
About enum
About polymorphism
About Optional
About hashes
About JitPack
About Dockerfile
About this ()
About devise
[Active Storage] Validation settings when uploading files
About encapsulation
About Docker
About JAVA_HOME
About active_hash
[Ruby on Rails] About Active Record callbacks
About static
About exceptions
Rails Active Storage shrinks images before uploading
About scope
Post / delete multiple images with Active Storage
[Maven] About Maven
[Rails] Show avatars in posts using Active Storage
How to link images using FactoryBot Active Storage