I am having trouble making any "common" WYSIWYG work with Rails. We even had to do one ourselves with RedCloth for the moment.
I tried to use tinymce-rails but couldn't make it work. Also tried nicEdit which worked but only when you called the online library (and also looks abandoned).
Has anyone worked with a good WYSIWYG that is jQuery and Rails 3.1 (Sprockets) friendly?
I use ckeditor in my Rails 3.1 app.
Just throw the folder into you lib/assets/javascripts and whenever you need it reference it like this:
= javascript_include_tag "ckeditor/ckeditor.js"
And in javascript:
:javascript
$(function(){
CKEDITOR.replace( 'input',
{
// Optional params:
skin : 'office2003',
height: '700px'
});
})
After struggling with this issue for quite awhile, I came up with a solution for using the standard tinyMCE with Rails 3.1 and the asset pipeline.
/vendor/assets/javascripts/tiny_mce
jquery.tinymce.js
inside of /vendor/assets/javascripts/tiny_mce
/public/javascripts
folder, inside of a directory called tiny_mce
Add tinyMCE to your application.js
like so:
//=require jquery
...
//=require tiny_mce/jquery.tinymce.js
I initialize tinyMCE in my application.js
as well, and set a script_url
path to tell tinyMCE that it's supporting files now live in my public/javascripts/tiny_mce
directory:
$('.tinymce').each(function(i){
$(this).tinymce({
script_url : '/javascripts/tiny_mce/tiny_mce.js',
...
That should work. Now you are using the asset pipeline to load tinyMCE, and serving the supporting assets and javascripts from the public directory.
The Mercury Editor looks promising. I'm planning to try it on my next rails project.
http://jejacks0n.github.com/mercury/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With