igorkasyanchuk / new_ckeditor Goto Github PK
View Code? Open in Web Editor NEWRuby on Rails + CKEditor 5
Home Page: https://www.railsjazz.com/
License: MIT License
Ruby on Rails + CKEditor 5
Home Page: https://www.railsjazz.com/
License: MIT License
Hi,
I wonder if it is possible to include superscript, subscript and pageBreak for the classic Editor.
ckeditor.js:5 toolbarview-item-unavailable: The requested toolbar item is unavailable. Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-toolbarview-item-unavailable
{name: 'superscript'}
It seems that the build generated for classic/ckeditor.js does not include those options.
When adding a screenshot, it diverges to the entire screen, I think an unpleasant bug. Ideas?
Error: Couldn't upload file: IMG_0329.JPG
Greeting. First of all, thanks for the gem! I'm trying to install it on activeadmin. Everything is fine,
but an error occurs when loading the image. What should I try to check, recommendations for finding an error?
It works fine, we add image loading
class FileUploadsController < ApplicationController
# note
# that method must return json with URL to an uploaded image
# or error message
def upload
image = CkEditorImage.new(file: params["upload"])
if image.save
render json: {
url: image.file.url
}
else
render json: {
"error": {
"message": image.errors.full_messages.join(", ")
}
}
end
end
end
Create a new model where images will be stored: rails g model CkEditorImage file:string user_id:integer parent_id:integer parent_type:string
class CkEditorImage < ApplicationRecord
mount_uploader :file, CkEditorImageUploader
belongs_to :user, optional: true
validates_presence_of :file
end
Code of migration may look like:
class CreateCkEditorImages < ActiveRecord::Migration[6.0]
def change
create_table :ck_editor_images do |t|
t.string :file
t.integer :user_id, index: true
t.integer :parent_id
t.string :parent_type
t.datetime :created_at
t.datetime :updated_at
end
add_index :ck_editor_images, :user_id
add_index :ck_editor_images, [:parent_id, :parent_type]
end
end
Run this migration.
Create Carrierwave uploader rails g uploader CkEditorImage.
Open and edit it if needed.
Official CKEditor documentation states that we should use npm
How do we proceed here?
Fantastic gem, thank you. I would like to use it in my CMS and I have added //= link new_ckeditor/classic/ckeditor.js
to the manifest.js but I am told The asset "new_ckeditor/classic/ckeditor.js" is not present in the asset pipeline
So I have looked for the javascript files and they are not present anywhere. I am obviously missing something.
I ran the new_ckeditor generator which generated the views fine
So where do the javascript file live please?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.