tinymce-rails
tinymce-rails copied to clipboard
tinymce.yml not being loaded (ActiveAdmin)
I'm using tinymce-rails with activeadmin. The editor is loading just fine following the instructions in the readme. However the config options are not being read from the config/tinymce.yml file.
Relevant files changed to enable functionality.
app/admin/species.rb
f.input :desc, label: "Description", input_html: {rows: 4, class: 'tinymce'}
config/initializers/active_admin.rb
config.register_javascript 'tinymce.js'
app/assets/javascripts/active_admin.js.coffee
#= require tinymce
`$(document).ready(function() {
tinyMCE.init({
selector: '.tinymce',
theme: 'modern'
});
});`
Ruby: 2.1.1p76 rails: 4.1.9 activeadmin: 1.0.0pre tinymce-rails: 4.1.10
To use config/tinymce.yml
, you'll need to find a place in your template or layout to include the TinyMCE init code.
See https://github.com/spohlenz/tinymce-rails/blob/master/lib/tinymce/rails/helper.rb for the possible parts that you can include, but the simplest option is just to call tinymce
.