Ruby on Rails 3.1, пользовательские панели инструментов Ckeditor. Где размещать определения

Я использовал гем для установки ckeditor. Таким образом, в проекте (нет config.js, который находится в фактической папке gem, которую я не хочу изменять ). При установке был создан файл ckeditor.js в папке config/initializers, который, казалось бы, является правильным местом для размещения определения панели инструментов. Но все, что я пытался заставить работать, выдает различные синтаксические или методические ошибки. Кто-нибудь добился успеха в этом? Если это так, быстрый пример был бы очень полезен.

Мой текущий ckeditor.js::

# Use this hook to configure ckeditor
if Object.const_defined?("Ckeditor")
  Ckeditor.setup do |config|

  # ==> ORM configuration
  # Load and configure the ORM. Supports :active_record (default), :mongo_mapper and
  # :mongoid (bson_ext recommended) by default. Other ORMs may be
  # available as additional gems.
  require "ckeditor/orm/active_record"

  # Allowed image file types for upload.
  # Set to nil or [] (empty array) for all file types
  # config.image_file_types = ["jpg", "jpeg", "png", "gif", "tiff"]

  # Allowed attachment file types for upload.
  # Set to nil or [] (empty array) for all file types
  # config.attachment_file_types = ["doc", "docx", "xls", "odt", "ods", "pdf", "rar", "zip", "tar", "swf"]
  end
end
6
задан Matthew Doering 23 April 2012 в 21:06
поделиться