1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/guides
Richard Böhme acf767dbd6 Allow to use pre-defined variants for previews
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) %>
2022-07-19 16:59:52 +02:00
..
assets Unify LTR / RTL CSS for guides 2022-06-22 16:42:48 -05:00
bug_report_templates No need to check for Ruby version on the bug reports template anymore 2022-01-06 20:50:33 +00:00
rails_guides Unify LTR / RTL CSS for guides 2022-06-22 16:42:48 -05:00
source Allow to use pre-defined variants for previews 2022-07-19 16:59:52 +02:00
.document
CHANGELOG.md Start Rails 7.1 development 2021-12-07 15:52:30 +00:00
rails_guides.rb
Rakefile Run the gem template guides for 3.1 now that 7.0.1 is out 2022-01-06 21:56:06 +00:00
w3c_validator.rb