I think I must be being really dense... I just can''t get resizing
versions to work with RMagick. Can someone show me an example of a
working configuration?
I''m using Rails 0.14.3, file_column 0.3, and the following
doesn''t work:
== db/migrate/010_add_image.rb
class AddItems < ActiveRecord::Migration
self.up
add_column :items, :image, :string
end
end
== app/models/item.rb
class Item < ActiveRecord::Base
file_column :image, :magick => {:versions =>
{ "thumb" => "50x50",
"medium" => "640x480>"} }
end
== app/controllers/item_controller.rb
class ItemController < ApplicationController
def upload_image
@item = Item.find(params[:id])
@item.image=params[:item][:image]
@item.save
redirect_to :action => ''show'', :id => params[:id]
end
end
== app/views/item/show.rhtml
<%= image_tag url_for_file_column(''item'',
''image'', ''medium'') %>
=
The last image tag comes out broken, and the thumbnail isn''t created.
No errors are showing in the logs, and google''s not being much help.
Is there anything obvious I''ve missed out?
--
Alex