Sha256: 534937c7c05f747c4cfd97ecf9854a9169734d0e182cb0877db402d8955dabd8

Contents?: true

Size: 876 Bytes

Versions: 15

Compression:

Stored size: 876 Bytes

Contents

class Ckeditor::Picture < Ckeditor::Asset
  has_attached_file :data,
                    url: "#{ENV['RAILS_RELATIVE_URL_ROOT'].presence}/ckeditor_assets/pictures/:id/:style_:basename.:extension",
                    path: ':rails_root/public/ckeditor_assets/pictures/:id/:style_:basename.:extension',
                    styles: { content: '800>', thumb: '118x100#' }

  validates_attachment_presence :data
  validates_attachment_size :data, less_than: 2.megabytes
  validates_attachment_content_type :data, content_type: /\Aimage/

  def url_content
    # url_t = (ENV['RAILS_URL'].blank? || ) ? "http://localhost:3000" : "#{ENV['RAILS_URL']}#{ENV['RAILS_RELATIVE_URL_ROOT']}"
    # return url(:content)
    # return "#{ENV['RAILS_URL'].presence}#{ENV['RAILS_RELATIVE_URL_ROOT'].presence}#{url(:content)}"
    return "#{ENV['RAILS_URL'].presence}#{url(:content)}"
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
thecore-1.7.7 app/models/ckeditor/picture.rb
thecore-1.7.5 app/models/ckeditor/picture.rb
thecore-1.7.3 app/models/ckeditor/picture.rb
thecore-1.7.2 app/models/ckeditor/picture.rb
thecore-1.7.1 app/models/ckeditor/picture.rb
thecore-1.7.0 app/models/ckeditor/picture.rb
thecore-1.6.13 app/models/ckeditor/picture.rb
thecore-1.6.10 app/models/ckeditor/picture.rb
thecore-1.6.9 app/models/ckeditor/picture.rb
thecore-1.6.8 app/models/ckeditor/picture.rb
thecore-1.6.7 app/models/ckeditor/picture.rb
thecore-1.6.5 app/models/ckeditor/picture.rb
thecore-1.6.4 app/models/ckeditor/picture.rb
thecore-1.6.3 app/models/ckeditor/picture.rb
thecore-1.6.2 app/models/ckeditor/picture.rb