Sha256: 75138fbbac102d05c35940d9f3986ff38d1dd0a93ef9deb2ad47a5e695643dfe

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

= DynamicImage

DynamicImage is a Rails plugin providing transparent uploading 
and processing of image files.

Images are processed and cached on demand without need for any 
configuration.


== Installation:

Install the gem:

 gem install dynamic_image

Add the gem to your Gemfile:

 gem 'dynamic_image'

Do the migrations:

 rails generate dynamic_image migrations
 rake db:migrate


== Getting started:

Use belongs_to_image in your models:

 class User
   belongs_to_image :profile_picture
 end

Create a form:

 <%= form_for @user, :html => {:multipart => true} do |f| %>
   Name: <%= f.text_field :name %>
   Profile picture: <%= f.file_field :profile_picture %>
   <%= submit_tag "Save" %>
 <% end %>

Use the dynamic_image_tag helper to show images:

 <%= dynamic_image_tag @user.profile_picture, :size => '64x64' %>
 <%= dynamic_image_tag @user.profile_picture, :size => '150x' %>


== Caching

Processing images on the fly is expensive. Therefore, page caching is enabled
by default, even in development mode. To disable page caching, add the following
line in your initializers or environment.rb:

 DynamicImage.page_caching = false

== Copyright

Copyright © 2006-2010 Inge Jørgensen. See LICENSE for details.
	

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dynamic_image-0.9.0 README.rdoc