Module: Ckeditor

Defined in:
lib/ckeditor.rb,
lib/ckeditor/http.rb,
lib/ckeditor/utils.rb,
lib/ckeditor/engine.rb,
lib/ckeditor/version.rb,
lib/ckeditor/orm/base.rb,
lib/ckeditor/orm/mongoid.rb,
lib/ckeditor/hooks/formtastic.rb,
lib/ckeditor/backend/paperclip.rb,
lib/ckeditor/hooks/simple_form.rb,
lib/ckeditor/orm/active_record.rb,
lib/ckeditor/backend/carrierwave.rb,
lib/ckeditor/helpers/controllers.rb,
lib/ckeditor/helpers/form_helper.rb,
lib/ckeditor/helpers/view_helper.rb,
lib/ckeditor/helpers/form_builder.rb,
lib/generators/ckeditor/models_generator.rb,
lib/generators/ckeditor/install_generator.rb

Defined Under Namespace

Modules: Backend, Generators, Helpers, Hooks, Http, Orm, Utils, Version Classes: Asset, AttachmentFile, AttachmentFilesController, BaseController, Engine, Picture, PicturesController

Constant Summary collapse

IMAGE_TYPES =
['image/jpeg', 'image/png', 'image/gif', 'image/jpg', 'image/pjpeg', 'image/tiff', 'image/x-png']
@@image_file_types =
["jpg", "jpeg", "png", "gif", "tiff"]
@@attachment_file_types =
["doc", "docx", "xls", "odt", "ods", "pdf", "rar", "zip", "tar", "tar.gz", "swf"]
@@path =
'public/javascripts'

Class Method Summary collapse

Class Method Details

.attachment_file_modelObject



50
51
52
# File 'lib/ckeditor.rb', line 50

def self.attachment_file_model
  Ckeditor::AttachmentFile.to_adapter
end

.path=(value) ⇒ Object



62
63
64
65
# File 'lib/ckeditor.rb', line 62

def self.path=(value)
  @@relative_path = nil
  @@path = value
end

.picture_modelObject



46
47
48
# File 'lib/ckeditor.rb', line 46

def self.picture_model
  Ckeditor::Picture.to_adapter
end

.public_pathObject



58
59
60
# File 'lib/ckeditor.rb', line 58

def self.public_path
  Rails.root.join('public')
end

.relative_pathObject



54
55
56
# File 'lib/ckeditor.rb', line 54

def self.relative_path
  @@relative_path ||= File.join("/", Rails.root.join(path).relative_path_from(public_path).to_s)
end

.setup {|_self| ... } ⇒ Object

Default way to setup Ckeditor. Run rails generate ckeditor to create a fresh initializer with all configuration values.

Yields:

  • (_self)

Yield Parameters:

  • _self (Ckeditor)

    the object that the method was called on



42
43
44
# File 'lib/ckeditor.rb', line 42

def self.setup
  yield self
end