TinyMCE:Ruby on Rails
From Moxiecode Documentation Wiki
Contents |
tinymce_hammer
tinymce_hammer is a Ruby on Rails plugin (requires 2.3+) that provides
- Easy, simple installation and usage, provides form helpers and form builder methods
- Fast, provides a single combined javascript for loading TinyMCE javascript
- Flexible, provide lazy loading support
Links
tinymce
To integrate TinyMCE into a Ruby on Rails application, there is a tiny_mce plugin created by Blake Watters, and maintained by KieranP. This plugin makes TinyMCE available to all textareas for the controllers and actions you choose. For an installation guide, see the README documentation of the plugin at http://github.com/kete/tiny_mce (hosted on Github). It includes full installation, upgrade, and configuration documentation that should get you started. If you have any questions or problems, please file a ticket at http://kete.lighthouseapp.com/projects/14744-tiny_mce/tickets and someone will help ASAP.
Additional Notes
The most crucial thing to keep in mind is to include the TinyMCE javascript library before the scriptaculous library in your layout or view (see the scriptaculous wiki). The best order seems to be:
- prototype.js
- tiny_mce.js
- scriptaculous.js
- tinyMCE.init({ ...options... })
If you don't want to/didn't manage to install the plugin, you can just download the javascript files to public/javascripts/tiny_mce and invoke TinyMCE the normal way in the head of the layout file for the views where you want to use it.
Further References / Notes
- Configure tinyMCE Spellcheck with rails app
- Integrating TinyMCE with the ajaxscaffold generator, see blog.katipo.co.nz (possibly outdated)
- Although TinyMCE does some HTML sanitizing, it's not advisable to rely on that because it can be easily circumvented (remember, it's just a client-side script). Better use something like technoweenie's white_list plugin. (possibly outdated)
- spellchecking (forum thread) (possibly outdated)
- GZip compressor (forum thread) (possibly outdated)
- integration with scriptaculous's InPlaceEdit (forum thread) (possibly outdated)
