Sha256: 46bc86b574da0b768557041c9201f8b4bbcb0f6df9862181d68b083cd76fde01

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

require 'rails_admin/config/fields/base'

module RailsAdmin
  module Config
    module Fields
      module Types
        class CKEditor < RailsAdmin::Config::Fields::Types::Text
          # Register field type for the type loader
          RailsAdmin::Config::Fields::Types::register(self)

          # If you want to have a different toolbar configuration for CKEditor
          # create your own custom config.js and override this configuration
          register_instance_option :config_js do
            nil
          end

          #Use this if you want to point to a cloud instances of CKeditor
          register_instance_option :location do
            nil
          end

          #Use this if you want to point to a cloud instances of the base CKeditor
          register_instance_option :base_location do
            "#{Rails.application.config.assets.prefix}/ckeditor/"
          end

          register_instance_option :html_attributes do
            {
              :cols => '48',
              :rows => '3'
            }
          end

          register_instance_option :partial do
            :form_ck_editor
          end

          [:base_location, :config_js, :location].each do |key|
            register_deprecated_instance_option :"ckeditor_#{key}", key
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_admin-0.5.0 lib/rails_admin/config/fields/types/ck_editor.rb