No release in over a year
Rails activeadmin integrated CKEditor 5
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

ActiveadminCkeditor

Rails activeadmin integrated CKEditor 5

Reference

CKEditor5

activeadmin

Installation

Add this line to your application's Gemfile:

gem 'activeadmin_ckeditor5'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install activeadmin_ckeditor5

Usage

ActiveAdmin.register Article do
#...
  form do |f|
    f.inputs 'Article' do
      f.input :title, label: 'title'
      f.input :content, as: :ckeditor, label: 'content'
    end
    actions
  end
#...
end

Define uploading route

  #config/routes.rb
  post :uploads, to: 'uploads#create'

Then define upload controller

class UploadsController < ApplicationController
  def create
    #TODO
  end
end

You will get a Can't verify CSRF token authenticity error when you uploading image

You can redefine csrf_meta_tag location

# config/initializers/active_admin_layout.rb
module AdminPageLayoutOverride
  def build_active_admin_head
    within head do
      # CKEditor simpleUpload components will use csrfToken, but can't find csrf_meta_tag when loading js
      # so the csrf_meta_tag is generated in advance here.
      text_node csrf_meta_tag
    end

    super
  end
end
ActiveAdmin::Views::Pages::Base.send :prepend, AdminPageLayoutOverride

Or skip verify authenticity token

class AdminUploadsController < AdminApplicationController
  skip_forgery_protection
  def create
    #TODO
  end
end