[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8010":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},8010,"ckeditor","galetahub\u002Fckeditor","galetahub","Ckeditor 4.x integration gem for rails","https:\u002F\u002Fckeditor.com\u002Fckeditor-4\u002F",null,"Ruby",2227,862,56,15,0,30.81,"MIT License",false,"master",true,[],"2026-06-12 02:01:47","# Ckeditor\n\n[![Build Status](https:\u002F\u002Fgaletahub.semaphoreci.com\u002Fbadges\u002Fckeditor\u002Fbranches\u002Fmaster.svg?style=shields&key=eabcab57-9b51-4460-9b27-9c61c28efcdb)](https:\u002F\u002Fgaletahub.semaphoreci.com\u002Fprojects\u002Fckeditor)\n[![Code Climate](https:\u002F\u002Fcodeclimate.com\u002Fgithub\u002Fgaletahub\u002Fckeditor\u002Fbadges\u002Fgpa.svg)](https:\u002F\u002Fcodeclimate.com\u002Fgithub\u002Fgaletahub\u002Fckeditor)\n[![Stand With Ukraine](https:\u002F\u002Fraw.githubusercontent.com\u002Fvshymanskyy\u002FStandWithUkraine\u002Fmain\u002Fbadges\u002FStandWithUkraine.svg)](https:\u002F\u002Fstand-with-ukraine.pp.ua)\n\n\nCKEditor is a WYSIWYG text editor designed to simplify web content creation. It brings common word processing features directly to your web pages. Enhance your website experience with our\ncommunity maintained editor. Currently this gem supports [ckeditor 4](https:\u002F\u002Fckeditor.com\u002Fckeditor-4\u002F) only.\n\n[![Stand With Ukraine](https:\u002F\u002Fraw.githubusercontent.com\u002Fvshymanskyy\u002FStandWithUkraine\u002Fmain\u002Fbanner-direct.svg)](https:\u002F\u002Fstand-with-ukraine.pp.ua)\n\n## Features\n\n* CKEditor version 5 (\u003Chttps:\u002F\u002Fckeditor.com\u002Fckeditor-5\u002Fdownload\u002F>)\n* Rails 7.x, 6.x, 5.x, 4.x integration\n* Files browser\n* HTML5 file uploader\n* Hooks for formtastic and simple_form forms generators\n* Integrated with authorization frameworks [CanCanCan](https:\u002F\u002Fgithub.com\u002FCanCanCommunity\u002Fcancancan) and [Pundit](https:\u002F\u002Fgithub.com\u002Fvarvet\u002Fpundit)\n\n## Installation\n\nFor basic usage just include the ckeditor gem:\n\n```\ngem 'ckeditor'\n```\n\nor if you'd like to use the latest version from Github:\n\n```\ngem 'ckeditor', github: 'galetahub\u002Fckeditor'\n```\n\nInclude this inside your `config\u002Finitializers\u002Fassets.rb`:\n\n```\nRails.application.config.assets.precompile += %w[ckeditor\u002Fconfig.js]\n```\n\nFor file upload support, you must generate the necessary file storage models.\nThe currently supported backends are:\n\n* ActiveRecord (active_storage, paperclip, carrierwave, dragonfly)\n* Mongoid (paperclip, carrierwave, dragonfly)\n\n### How to generate models to store uploaded files\n\n#### ActiveRecord + paperclip\n\nTo use the active_record orm with paperclip (i.e. the default settings):\n\n```\ngem 'paperclip'\n\nrails generate ckeditor:install --orm=active_record --backend=paperclip\n```\n\n#### ActiveRecord + active_storage\n\n```\ngem \"mini_magick\"\n\nrails active_storage:install # if you haven't installed active_storage yet\nrails generate ckeditor:install --orm=active_record --backend=active_storage\n```\n\n#### ActiveRecord + carrierwave\n\n```\ngem 'carrierwave'\ngem 'mini_magick'\n\nrails generate ckeditor:install --orm=active_record --backend=carrierwave\n```\n\n#### ActiveRecord + dragonfly\n\nRequires Dragonfly 1.0 or higher.\n\n```\ngem 'dragonfly'\n\nrails generate ckeditor:install --orm=active_record --backend=dragonfly\n```\n\n#### Mongoid + paperclip\n\n```\ngem 'mongoid-paperclip', require: 'mongoid_paperclip'\n\nrails generate ckeditor:install --orm=mongoid --backend=paperclip\n```\n\n#### Mongoid + active_storage\n\nActive Storage support **only** Active Record, see for [more info](https:\u002F\u002Fgithub.com\u002Frails\u002Frails\u002Fissues\u002F31408#issuecomment-351128111)\n\n#### Mongoid + carrierwave\n\n```\ngem 'carrierwave-mongoid', require: 'carrierwave\u002Fmongoid'\ngem 'mini_magick'\n\nrails generate ckeditor:install --orm=mongoid --backend=carrierwave\n```\n\n#### Load generated models\n\nAll ckeditor models will be generated in the app\u002Fmodels\u002Fckeditor directory.\nModels are autoloaded in Rails 4. For earlier Rails versions, you need to add them to the autoload path (in application.rb):\n\n```ruby\nconfig.autoload_paths += %w(#{config.root}\u002Fapp\u002Fmodels\u002Fckeditor)\n```\n\nMount the Ckeditor::Engine to your routes (config\u002Froutes.rb):\n\n```ruby\nmount Ckeditor::Engine => '\u002Fckeditor'\n```\n\n## Usage\n\n### Load editor via CKEditor CDN\n\nSetup editor version to load (more info here \u003Chttp:\u002F\u002Fcdn.ckeditor.com\u002F>)\n\n```ruby\n# in config\u002Finitializers\u002Fckeditor.rb\n\nCkeditor.setup do |config|\n  # \u002F\u002Fcdn.ckeditor.com\u002F\u003Cversion.number>\u002F\u003Cdistribution>\u002Fckeditor.js\n  config.cdn_url = \"\u002F\u002Fcdn.ckeditor.com\u002F4.6.1\u002Fbasic\u002Fckeditor.js\"\nend\n```\n\nIn view template include ckeditor CDN:\n\n```slim\n= javascript_include_tag Ckeditor.cdn_url\n```\n\nPrecompile ckeditor\u002Fconfig.js:\n\n```ruby\n# in config\u002Finitializers\u002Fassets.rb\n\nRails.application.config.assets.precompile += %w[ckeditor\u002Fconfig.js]\n```\n\n### Form helpers\n\n```slim\n= form_for @page do |form|\n  = form.cktext_area :notes, class: 'someclass', ckeditor: { language: 'uk'}\n  = form.cktext_area :content, value: 'Default value', id: 'sometext'\n  = cktext_area :page, :info, cols: 40, ckeditor: { uiColor: '#AADC6E', toolbar: 'mini' }\n```\n\n*It also works with bootstrap-form*\n\n```slim\n= bootstrap_form_for resource do |form|\n  = form.cktext_area :text, ckeditor: { language: 'uk'}\n```\n\n### Customize ckeditor\n\nAll ckeditor options can be found [here](http:\u002F\u002Fdocs.ckeditor.com\u002F#!\u002Fapi\u002FCKEDITOR.config)\n\nIn order to configure the ckeditor default options, create the following files:\n\n```\napp\u002Fassets\u002Fjavascripts\u002Fckeditor\u002Fconfig.js\n\napp\u002Fassets\u002Fjavascripts\u002Fckeditor\u002Fcontents.css\n```\n\n#### Custom toolbars example\n\nAdding a custom toolbar:\n\n```javascript\n# in app\u002Fassets\u002Fjavascripts\u002Fckeditor\u002Fconfig.js\n\nCKEDITOR.editorConfig = function (config) {\n  \u002F\u002F ... other configuration ...\n\n  config.toolbar_mini = [\n    [\"Bold\",  \"Italic\",  \"Underline\",  \"Strike\",  \"-\",  \"Subscript\",  \"Superscript\"],\n  ];\n  config.toolbar = \"mini\";\n\n  \u002F\u002F ... rest of the original config.js  ...\n}\n```\n\nWhen overriding the default `config.js` file, you must set all configuration options yourself as the bundled `config.js` will not be loaded. To see the default configuration, run `bundle open ckeditor`, copy `app\u002Fassets\u002Fjavascripts\u002Fckeditor\u002Fconfig.js` into your project and customize it to your needs.\n\n#### Install additional plugins\n\nYou should download necessary plugins with all dependencies and extract them in `app\u002Fassets\u002Fjavascripts\u002Fckeditor\u002Fplugins\u002F`.\nAfter that you can include your plugins in `app\u002Fassets\u002Fjavascripts\u002Fckeditor\u002Fconfig.js` in this way:\n\n```javascript\nCKEDITOR.editorConfig = function (config) {\n  config.extraPlugins = 'eqneditor,autosave,';\n}\n```\n\n### AJAX\n\njQuery sample:\n\n```html\n\u003Cscript type='text\u002Fjavascript' charset='UTF-8'>\n  $(document).ready(function(){\n    $('form[data-remote]').bind('ajax:before', function(){\n      for (instance in CKEDITOR.instances){\n        CKEDITOR.instances[instance].updateElement();\n      }\n    });\n  });\n\u003C\u002Fscript>\n```\n\n### Formtastic integration\n\n```slim\n= form.input :content, as: :ckeditor\n= form.input :content, as: :ckeditor, input_html: { ckeditor: { height: 400 } }\n```\n\n### SimpleForm integration\n\nNote that the toolbar option should match the case specified in the config. If the config is not found it defaults to all available toolbar items.\n\ni.e. config.toolbar_mini becomes {toolbar: 'mini'} in the form.\n\n```slim\n= form.input :content, as: :ckeditor, input_html: { ckeditor: { toolbar: 'Full' } }\n```\n\n### Turbolink integration\n\nCreate a file app\u002Fassets\u002Fjavascripts\u002Finit_ckeditor.coffee\n\n```coffee\nready = ->\n  $('.ckeditor').each ->\n    CKEDITOR.replace $(this).attr('id')\n\n$(document).ready(ready)\n$(document).on('page:load', ready)\n```\n\nMake sure the file is loaded from your app\u002Fassets\u002Fjavascripts\u002Fapplication.js\n\n### CanCanCan integration\n\nTo use cancan with Ckeditor, add this to an initializer:\n\n```ruby\n# in config\u002Finitializers\u002Fckeditor.rb\n\nCkeditor.setup do |config|\n  config.authorize_with :cancancan\nend\n```\n\nAt this point, all authorization will fail and no one will be able to access the filebrowser pages.\nTo grant access, add the following abilities (usually `ability.rb`)\n\n```ruby\n# Always performed\ncan :access, :ckeditor   # needed to access Ckeditor filebrowser\n\n# Performed checks for actions:\ncan [:read, :create, :destroy], Ckeditor::Picture\ncan [:read, :create, :destroy], Ckeditor::AttachmentFile\n```\n\n### Pundit or Action Policy Integration\n\nSetup Pundit and Action Policy similar.\nJust like CanCanCan, you can write this code in your config\u002Finitializers\u002Fckeditor.rb file:\n\n```ruby\nCkeditor.setup do |config|\n  config.authorize_with :pundit # or :action_policy\nend\n```\n\nThen, generate the policy files for model **Picture** and **AttachmentFile**\n\n```\nrails g ckeditor:pundit_policy # or ckeditor:action_policy\n```\n\nBy this command, you will got two files:\n> app\u002Fpolicies\u002Fckeditor\u002Fpicture_policy.rb\napp\u002Fpolicies\u002Fckeditor\u002Fattachment_file_policy.rb\n\nBy default, only the user that logged in can access the models.\n\nYou can customize these two policy files as you like.\n\n## Engine configuration\n\n* To override the default CKEditor routes create a [config.js](https:\u002F\u002Fgithub.com\u002Fgaletahub\u002Fckeditor\u002Fblob\u002Fmaster\u002Fapp\u002Fassets\u002Fjavascripts\u002Fckeditor\u002Fconfig.js) file within the host application at `app\u002Fassets\u002Fjavascripts\u002Fckeditor\u002Fconfig.js`\n\n* By default, the engine inherits from `ApplicationController`. To override the default parent controller:\n\n```\n# in config\u002Finitializers\u002Fckeditor.rb\n\nCkeditor.setup do |config|\n  config.parent_controller = 'MyCKEditorBaseController'\nend\n```\n\nBased on this, if you want to secure CKEditor controller actions and you can't authenticate in ApplicationController, you could do so with a custom controller after configuring the override above, like so:\n\n```\nclass MyCKEditorBaseController \u003C ActionController::Base\n\n  before_action :authenticate_user! # or some other auth\u002Fpermission logic here, like Pundit\n\nend\n```\n\n## I18n\n\n```yml\nen:\n  ckeditor:\n    page_title: 'CKEditor Files Manager'\n    confirm_delete: 'Delete file?'\n    buttons:\n      cancel: 'Cancel'\n      upload: 'Upload'\n      delete: 'Delete'\n      next: 'Next'\n```\n\n## Tests\n\n```bash\n$> rake test CKEDITOR_BACKEND=paperclip\n$> rake test CKEDITOR_BACKEND=active_storage\n$> rake test CKEDITOR_BACKEND=carrierwave\n$> rake test CKEDITOR_BACKEND=dragonfly\n$> rake test CKEDITOR_BACKEND=shrine\n$> rake test CKEDITOR_ORM=mongoid\n\n$> rake test:controllers\n$> rake test:generators\n$> rake test:integration\n$> rake test:models\n```\n\nThis project rocks and uses the MIT-LICENSE.\n","该项目是用于将CKEditor 4.x集成到Rails应用中的Ruby gem。它支持丰富的文本编辑功能，如所见即所得（WYSIWYG）编辑、文件浏览器、HTML5文件上传等，并且可以与多种表单生成器及授权框架（例如CanCanCan和Pundit）无缝对接。此外，该gem还提供了对不同ORM（如ActiveRecord、Mongoid）及其存储后端的支持，包括ActiveStorage、Paperclip、CarrierWave等。适用于需要在Rails项目中提供强大富文本编辑能力的场景，如博客平台、内容管理系统等。",2,"2026-06-11 03:15:38","top_language"]