나는 다음과 같은 코드가 있습니다은 관리자 디스플레이 레일 : 엄지 손가락 이미지를
config/initializers/rails_admin.rb
list do
field :id #currentId set in app/views/rails_admin/main/index
field :year
field :title
field :intro
field :description
field :confidential
field :star
field :image do
formatted_value do
bindings[:view].tag(:img, { :src => bindings[:object].image.url(:thumb)})
end
end
end
이
app/models/submission.rb
class Submission < ActiveRecord::Base
# Image attachment and validations
has_attached_file :file,
:url => "/files/:class/:attachment/:id/:style/:basename.:extension",
:path => ":rails_root/public/files/:class/:attachment/:id/:style/:basename.:extension",
:styles => { :thumb => "100x100#", :small => "150x150>", :medium => "200x200" }
# Validate attachment type
validates_attachment_content_type :file, :content_type => 'application/pdf'
end
질문 : 목록보기에서 왜 것을 얻을하지 않습니다를 :thumb
이미지와 나는 매우 큰 이미지를 얻는다. 자르고있는 절차가 전혀 작동하지 않는 것 같아요?
당신이 후 새로운 제출을 만든 따라 모달 및 구현을 확인 생각의 크기를 조정할 수 이 스타일 구성을 추가 하시겠습니까 ?? –
예, 방금 새 프로젝트를 추가했는데 이미지가 여전히 매우 큰 것처럼 표시됩니다! –
: content_type => 'application/pdf'왜 PDF의 유효성을 검사합니까 ?? –