README.md in tori-0.0.3 vs README.md in tori-0.0.4
- old
+ new
@@ -54,10 +54,31 @@
= form_for @photo, multipart: true |f|
= f.file_field 'image'
= f.button 'Upload'
```
-# default configure
+You can read file.
+
+```ruby
+photo.image.read #=> image bin
+photo.image.exist? #=> exist check
+photo.image.to_s #=> filename
+```
+
+# Custom configure example
+
+```ruby
+# Save to S3 bucket.
+require 'tori/backend/s3'
+Tori.config.backend = Tori::Backend::S3.new('tori_bucket')
+
+# Filename decided by model.class.name,id and hidden words.
+Tori.config.filename_callback do |model|
+ "#{model.class.name}/#{Digest::SHA1.hexdigest "#{ENV["TORI_MAGICKWORD"]}/#{model.id}"}"
+end
+```
+
+# Default configure
[https://github.com/ksss/tori/blob/master/lib/tori.rb](https://github.com/ksss/tori/blob/master/lib/tori.rb)
You can change configure any time.