diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-21 16:49:00 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-21 16:49:00 -0500 |
commit | 2e9ff80e50fee0df6ea47d4d43a27c4505985b29 (patch) | |
tree | cf7ec33b468a34cc6f3f8b0f4acd1922654bb74f | |
parent | f3b092a6e6f6d873e14ebe1e612028ef7ac15e4a (diff) | |
download | rails-2e9ff80e50fee0df6ea47d4d43a27c4505985b29.tar.gz rails-2e9ff80e50fee0df6ea47d4d43a27c4505985b29.tar.bz2 rails-2e9ff80e50fee0df6ea47d4d43a27c4505985b29.zip |
Quick example of variants
-rw-r--r-- | README.md | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -63,6 +63,13 @@ class MessagesController < ApplicationController end ``` +Variation of image attachment: + +```erb +<%# Hitting the variant URL will lazy transform the original blob and then redirect to its new service location %> +<%= image_tag url_for(user.avatar.variant(resize: "100x100")) %> +``` + ## Installation 1. Add `require "active_storage"` to config/application.rb, after `require "rails/all"` line. |