Ruby on rails CKEEDITOR导轨和回形针工作不正常
我使用的是ckeditorrails(),在上传图像时遇到了一些问题。上传照片的模型如下所示:Ruby on rails CKEEDITOR导轨和回形针工作不正常,ruby-on-rails,amazon-s3,ckeditor,paperclip,Ruby On Rails,Amazon S3,Ckeditor,Paperclip,我使用的是ckeditorrails(),在上传图像时遇到了一些问题。上传照片的模型如下所示: class Ckeditor::Picture < Ckeditor::Asset has_attached_file :data, :styles => { :content => '800>', :thumb => '118x100#' }, :s3_credentials =>
class Ckeditor::Picture < Ckeditor::Asset
has_attached_file :data,
:styles => { :content => '800>', :thumb => '118x100#' },
:s3_credentials => "#{Rails.root}/config/s3.yml",
:bucket => "********"
validates_attachment_size :data, :less_than => 2.megabytes
validates_attachment_presence :data
def url_content
url(:content)
end
end
class-Ckeditor::Picture{:content=>'800>,:thumb=>'118x100#'},
:s3_credentials=>“#{Rails.root}/config/s3.yml”,
:bucket=>“********”
验证附件大小:数据,:小于=>2.MB
验证附件是否存在:数据
def url_内容
url(:内容)
终止
终止
当我使用CKEditor上传图像时,图像的URL是一个路径,格式为“/system//pictures/data/000/000/016/content/**.jpg”
图像似乎没有被上传。我在模型中使用了此设置,请尝试此设置
has_attached_file :logo, :styles => { :orig => "300x400>",
:thumb => {:geometry => "80x58#", :format => :png},
:full => {:geometry => "#{SEARCH_IMAGE_WIDTH}x#{SEARCH_IMAGE_HEIGHT}#", :format => :png, :jcrop => true},
:cropped => {:geometry => "#{LOGO_WIDTH}x#{LOGO_HEIGHT}>", :jcrop => true, :format => :png} },
:storage => :s3,
:s3_credentials => "#{Rails.root.to_s}/config/s3.yml",
:path => "logos/:id/:style/:basename.:extension",
:bucket => "photo/#{Rails.env}/system"