Class: CKEditor5::Rails::Assets::WebComponentBundle
- Inherits:
-
Object
- Object
- CKEditor5::Rails::Assets::WebComponentBundle
- Includes:
- ActionView::Helpers::TagHelper, Singleton
- Defined in:
- lib/ckeditor5/rails/assets/webcomponent_bundle.rb
Constant Summary collapse
- NPM_PACKAGE_PATH =
File.join(__dir__, '..', '..', '..', '..', 'npm_package').freeze
Instance Method Summary collapse
Instance Method Details
#source ⇒ Object
13 14 15 |
# File 'lib/ckeditor5/rails/assets/webcomponent_bundle.rb', line 13 def source @source ||= File.read(File.join(NPM_PACKAGE_PATH, 'dist/index.cjs')).html_safe end |
#to_html(nonce: nil) ⇒ Object
17 18 19 |
# File 'lib/ckeditor5/rails/assets/webcomponent_bundle.rb', line 17 def to_html(nonce: nil) tag.script(source, type: 'module', nonce: nonce) end |