README.md in attachy-0.1.0 vs README.md in attachy-0.1.1

- old
+ new

@@ -1,10 +1,10 @@ # Attachy -Attachments handler for Rails via Cloudinary +Attachments handler for Rails via http://cloudinary.com -## Desciption +## Description Send files from your browser directly to Cloudinary. Attachy will generate a `has_one` or `has_many` files (photos) to your model with no need to change your model schema! @@ -46,50 +46,70 @@ ### View Expose your Cloudinary credentials on your layout: ```html -<%= cloudinary_js_config %>s +<%= cloudinary_js_config %> ``` -Into your form the upload field: +Into your form, add the upload field: ```html <%= f.attachy :avatar %> ``` -If you want just show your uploaded image, use: - -```html -<%= attachy_link :avatar, @object %> -``` - -It will generate a link to your image with the image inside. - ### Assets Includes the `attachy.js` on your js manifest: ```js -//= require vendor/attachy +//= require attachy ``` Includes the `attachy.sass` on your css manifest: ```js /* - *= require vendor/attachy + *= require attachy */ ``` ### <a name="default-image"></a> Configurations -On your `attachy.yml` configure a default image to show when model has no one: +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 +``` + +## Showing + +If you want just show your uploaded image, use: + +```html +<%= attachy_link :avatar, @object %> +``` + +It will generate a link to your image with the image inside. + +## Transformation + +You can manipulate the image using the `t` attribute: + +``` +<%= f.attachy :avatar, t: { width: 160, height: 160, crop: :fill } %> +``` + +To know more about transformations, check the [Cloudinary Doc](http://cloudinary.com/documentation/image_transformations). + +## HTML + +For HTML attributes, just use `html`: + +``` +<%= f.attachy :avatar, html: { width: 160, height: 160, alt: 'Image' } %> ``` ## Test Before send pull request, check if specs is passing.