mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
acf767dbd6
Previously, named variants could only be used when calling the `variant` method on an attachment. For files that are not `variable?` but `previewable?` those pre-defined variants could not be used. With this patch, the methods `preview` and `representation` also allow to be passed a variation name as a symbol. class User < ActiveRecord::Base has_one_attached :file do |attachable| attachable.variant :thumb, resize_to_limit: [100, 100] end end <%= image_tag user.file.representation(:thumb) %> |
||
---|---|---|
.. | ||
assets | ||
bug_report_templates | ||
rails_guides | ||
source | ||
.document | ||
CHANGELOG.md | ||
rails_guides.rb | ||
Rakefile | ||
w3c_validator.rb |