aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2017-07-21 16:49:00 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2017-07-21 16:49:00 -0500
commit2e9ff80e50fee0df6ea47d4d43a27c4505985b29 (patch)
treecf7ec33b468a34cc6f3f8b0f4acd1922654bb74f
parentf3b092a6e6f6d873e14ebe1e612028ef7ac15e4a (diff)
downloadrails-2e9ff80e50fee0df6ea47d4d43a27c4505985b29.tar.gz
rails-2e9ff80e50fee0df6ea47d4d43a27c4505985b29.tar.bz2
rails-2e9ff80e50fee0df6ea47d4d43a27c4505985b29.zip
Quick example of variants
-rw-r--r--README.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/README.md b/README.md
index 625b960624..48a33f8b3d 100644
--- a/README.md
+++ b/README.md
@@ -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.