README.md in attachy-0.4.0 vs README.md in attachy-0.4.1
- old
+ new
@@ -17,12 +17,12 @@
```ruby
gem 'attachy'
```
-So, extracts the necessary files including a migrate that create a table used
-to keep your file metadata. You can choose a [Default Image](#default-image) via params 'version', `public_id` and 'format'.
+So, extracts the necessary files including a migrate that create a table used to keep your file metadata.
+You can choose a [Default Image](#default-image) via params `version`, `public_id` and `format`.
```bash
rails g attachy:install
```
@@ -84,25 +84,27 @@
### <a name="default-image"></a> Configurations
On your `attachy.yml` you can configure a default image to show when model has no file attached:
-```js
-format: jpg
-public_id: default
-version: 42
+```yml
+default:
+ image:
+ format: jpg
+ public_id: default
+ version: 42
```
## Transformations
To know more about transformations, check the [Cloudinary Doc](http://cloudinary.com/documentation/image_transformations).
## Helpers
### Attachy
-```
+```html
<%= f.attachy :avatar,
t: { width: 160, height: 160, crop: :fill },
tl: { width: 800, height: 600, crop: :scale },
button: { html: { text: 'Upload' } }
%>
@@ -110,11 +112,11 @@
+ `t`: image transformations;
+ `tl`: linked image transformations;
+ `button.html`: button html attributes.
-```
+```html
<div class="attachy">
<ul class="attachy__content">
<li class="attachy__node">
<a class="attachy__link" href="">
<img src="">
@@ -147,11 +149,11 @@
## Link
It draws the link with the image inside:
-```
+```html
<%= attachy_link :avatar, @object
t: { width: 160, height: 160, crop: :fill },
tl: { width: 800, height: 600, crop: :scale },
html: { class: :added_custom }
%>
@@ -159,30 +161,30 @@
+ `t`: image transformations;
+ `tl`: linked image transformations;
+ `html`: link html attributes.
-```
+```html
<a class="attachy__link" href="">
<img src="">
</a>
```
### Image
-It draws the link with the image inside:
+It draws the image:
-```
+```html
<%= attachy_image :avatar, @object
t: { width: 160, height: 160, crop: :fill },
html: { alt: :me }
%>
```
+ `t`: image transformations;
+ `html`: link html attributes.
-```
+```html
<img src="https://res.cloudinary.com/account/image/upload/secret/version/hash.format">
```
## Test