Commit 65546a59

morilla <mo@mokhan.ca>
2011-05-05 16:19:38
add rmagick gem for creating thumbnails of uploaded images.
1 parent 5832969
Changed files (4)
app/uploaders/image_uploader.rb
@@ -3,7 +3,7 @@
 class ImageUploader < CarrierWave::Uploader::Base
 
   # Include RMagick or ImageScience support:
-  # include CarrierWave::RMagick
+  include CarrierWave::RMagick
   # include CarrierWave::ImageScience
 
   # Choose what kind of storage to use for this uploader:
@@ -29,9 +29,9 @@ class ImageUploader < CarrierWave::Uploader::Base
   # end
 
   # Create different versions of your uploaded files:
-  # version :thumb do
-  #   process :resize_to_limit => [300, 139]
-  # end
+  version :thumb do
+    process :resize_to_limit => [300, 139]
+  end
 
   # Add a white list of extensions which are allowed to be uploaded.
   # For images you might use something like this:
public/stylesheets/organic.css
@@ -12,6 +12,7 @@ table {background-color: #fff;}
 td {background-color: #fff;}
 th {background-color: #fff;}
 li {background-color: #fff;}
+pre {background-color: #fff;}
 
 img { border:none;	}
 .clear{ clear:both;	}
Gemfile
@@ -12,7 +12,7 @@ gem 'jquery-rails'
 gem 'carrierwave'
 gem 'RedCloth', '>= 4.1.1'
 gem 'omniauth'
-#gem 'rmagick'
+gem 'rmagick'
 
 # Use unicorn as the web server
 # gem 'unicorn'
Gemfile.lock
@@ -134,6 +134,7 @@ GEM
     rake (0.8.7)
     rest-client (1.6.1)
       mime-types (>= 1.16)
+    rmagick (2.13.1)
     rspec (2.5.0)
       rspec-core (~> 2.5.0)
       rspec-expectations (~> 2.5.0)
@@ -177,6 +178,7 @@ DEPENDENCIES
   jquery-rails
   omniauth
   rails (= 3.0.3)
+  rmagick
   rspec-rails
   sqlite3-ruby
   webrat