Thursday, July 8, 2010

[Rails] Re: How to create thumbnail

catz wrote:
> Just try paperclip, very simple solution for it.

+1 for the paperclip recommendation, but you also need some image
processing package installed and available... ImageMagick, or something
similar.

Then it's almost as simple as:

class Image < ActiveRecord::Base
has_attachment :content_type => ['image/jpeg', 'image/png'],
:storage => :file_system,
:max_size => 500.kilobytes,
:resize_to => '800x600>',
:thumbnails => { :thumb => '100x100>'}
end

in your model. There are plenty of tutorials out there available via
Googling.
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate