# Active Storage

Active Storage is a way to handle file uploads at ease that was introduced in Rails 5. It makes uploading and processing files in your rails applications reallystraight forward.

## Resize and crop an avatar image to a square

```ruby
image_tag user.avatar.variant(combine_options: {resize: '256x256^', extent: '256x256', gravity: 'Center'})
```

[Source](https://grosse.io/blog/posts/ActiveStorage-avatar-image-with-resize-crop)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.christianpoplawski.de/ruby-on-rails/active-storage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
