Important changes to Tiny Cloud pricing > Find out more
Return to Website

Implement TinyMCE in Ruby on Rails

In your RubyOnRails application you can just invoke TinyMCE in the standard way, in the layout file, or just for the views in which you want to use TinyMCE. A good place for TinyMCE files may be public/javascripts/tiny_mce directory, but you are free to choose any other location.

The plugins listed below will just make this task even easier.

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:

  1. prototype.js
  2. tiny_mce.js
  3. scriptaculous.js
  4. tinyMCE.init({ ...options... })

tiny_mce plugin

To integrate TinyMCE into a Ruby on Rails application, there is a tiny_mce plugin originally 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.

Links

tinymce_hammer plugin

tinymce_hammer is a Ruby on Rails plugin (requires Rails 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

See also:

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.