Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update active_storage_overview.md #51759

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

trebeil
Copy link

@trebeil trebeil commented May 7, 2024

Adds information about how to pass additional arguments to transformations.

Motivation / Background

This Pull Request has been created because the right syntax for passing optional arguments for transformation methods in an attachment variant call is not documented anywhere and it is not intuitive. Yet, it is probably needed by many people who use ActiveStorage to create variants of attachments.

Detail

This Pull Request adds a few lines to the ActiveStorage guide showing how to pass additional arguments to a transformation method in an attachment variant call.

Additional information

Doesn't apply.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

Adds information about how to pass additional arguments to transformations.
@rails-bot rails-bot bot added the docs label May 7, 2024
@@ -961,6 +961,11 @@ location.
<%= image_tag user.avatar.variant(resize_to_limit: [100, 100]) %>
```

Some transformations accept optional arguments. Pass any additional arguments to the transformation function as key: value pairs inside a hash:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Some transformations accept optional arguments. Pass any additional arguments to the transformation function as key: value pairs inside a hash:
Some transformations accept optional arguments. Pass any additional arguments to the transformation function as key: value pairs inside a hash:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants