안녕하세요 저는 paperclip을 사용하여 내 앱에 회사 아바타를 업로드하고 저장하고 있습니다. 이는이 회사의 모델에 모습입니다 :image_tag 클립 클립이 업로드되지 않았습니다.
has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "/images/missing.png"
validates_attachment_content_type :avatar, :content_type => /\Aimage\/.*\Z/
나는 또한 초기화를 사용하고, paperclip.rb :
Paperclip::Attachment.default_options[:storage] = :fog
Paperclip::Attachment.default_options[:fog_credentials] = {:provider => "Local", :local_root => "#{Rails.root}/public"}
Paperclip::Attachment.default_options[:fog_directory] = ""
Paperclip::Attachment.default_options[:fog_host] = "http://localhost:3000"
이미지가 제대로 저장되지만, 내가 이런 식으로이를 표시 할 때 :
<%= image_tag @company.avatar.url(:thumb) %>
파일 이름 만 표시합니다.
<img alt="Mini cooper" src="http://localhost:3000/companies/avatars/000/000/003/thumb/mini-cooper.jpg%3F1416616058">
을 그리고 난 다음과 같이 .JPG 후 문자를 꺼낼 경우 :
HTML은 다음과 같습니다
http://localhost:3000/companies/avatars/000/000/003/thumb/mini-cooper.jpg
을 나는 이미지가 잘 참조하십시오. 그러나 도우미는 단지 추가 문자로 URL을 만듭니다. 아이디어가 있으십니까?
안녕하세요! 업데이트 후에도 동일한 문제가 발생합니다. admin 및 clipclip. 동일한 보석 목록 (이전 보석 버전)을 사용하는 이전 프로젝트가 올바르게 작동하고이 문자가 – kpblc