你怎么获得http://github.com/galetahub/rails-ckeditor http://github.com/galetahub/rails-ckeditor工作,以便您可以上传图像文件?我认为我不会使用 s3 存储...
任何帮助,将不胜感激。
是的你可以。我假设您已经为 S3 设置了回形针。因此,您只需编辑模型目录(app/model/ckeditor/)中的 picture.rb 和 Attachment_file.rb 并替换这些行
has_attached_file :data,
:url => "/ckeditor_assets/attachments/:id/:filename",
:path => ":rails_root/public/ckeditor_assets/attachments/:id/:filename"
使用您的回形针版本 has_attached_file:
has_attached_file :data, :styles => { :content => '575>', :thumb => '80x80#' },
:storage => :s3, :s3_credentials => "#{Rails.root}/config/s3.yml", :path => ":attachment/:id/:style.:extension",
:url => ":s3_domain_url"
就是这样。顺便说一句:这是 Rails 3 的示例。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)