Skip to content

Commit 8887b65

Browse files
trebeilvipulnsward
authored andcommitted
Update active_storage_overview.md [ci-skip]
Adds information about how to pass additional arguments to transformations. Co-authored-by: Vipul A M <[email protected]>
1 parent 7c1db0d commit 8887b65

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

guides/source/active_storage_overview.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,12 @@ location.
961961
<%= image_tag user.avatar.variant(resize_to_limit: [100, 100]) %>
962962
```
963963

964+
Some transformations accept optional arguments. Pass any additional arguments to the transformation function as key: value pairs inside a hash:
965+
966+
```erb
967+
<%= image_tag user.avatar.variant(resize_to_fill: [100, 100, { crop: :centre }]) %>
968+
```
969+
964970
If a variant is requested, Active Storage will automatically apply
965971
transformations depending on the image's format:
966972

0 commit comments

Comments
 (0)