0
irb(main):001:0> e = Event.last
=> #<Event id: 7, address: "123 Main St", start_date: "2011-02-09", start_time: "2000-01-01 14:49:00", title: "Test Event", poster_file: "\377���JFIF\000\001\002\000\000d\000d\000\000\377�Ducky\000\001\000\004\000\000\0002\000\000\377�!Adobe\000d�...", poster_thumb_file: nil, created_at: "2011-02-09 14:49:45", updated_at: "2011-02-09 14:49:45", poster_file_name: nil, poster_content_type: "image/jpeg", poster_file_size: 134218, poster_updated_at: "2011-02-09 14:49:44">
irb(main):002:0> e.poster.url
=> "/posters/original/missing.png?1297262984"
我使用Pat Shaughnessy的回形針寶石的叉子。我也嘗試過,並且發現了另一個發現here的叉子的相同問題,所以我很確定這只是我做了一些愚蠢的事情。我的應用程序託管在heroku上。 我跟着誰最初分叉的回形針和努力去適應他們到Rails 3.我對海報的路線是這樣的人the instructions:回形針DB存儲:附件進去,但不出來
resources :events do
member do
get :poster
end
end
,並在控制器中,我有:
class EventsController < ApplicationController
downloads_files_for :event, :poster
...
end
和型號:
class Event < ActiveRecord::Base
attr_accessor :poster_thumb_file, :poster_file_name
has_attached_file :poster, :storage => :database, :styles => {:thumb => { :geometry => "100x100>", :column => 'poster_thumb_file'}}
end
我想不通我缺少什麼讓這些圖像顯示。任何意見,將不勝感激!
感謝您回答帕特。由於某種原因,它仍然不起作用。我可以在DB中看到他們。到目前爲止距離很近...... – mikewilliamson 2011-02-09 20:43:59