TinyMCE Hammer (tinymce_hammer) is a Ruby On Rails plugin that makes it easy to add Moxiecode's rich text editor to your forms. The tinymce_hammer plugin requires Ruby on Rails 2.3 or better.
I developed tinymce_hammer in my work with LuxuryRealEstate.com. It is currently in use on a large number of member facing pages and performs admirably. We choose to load TinyMCE using this plugin with ajax (we lazy load it).
- Easy to use
- Two-step installation and you are ready to go. Form helpers are provided for most common cases.
This is a quick-start guide to getting a TinyMCE editor in your Rails application. You can find more examples / tutorials here.
The default install path is
Now we need to enable TinyMCE with the following function, just call it somewhere in your layout (inside the head tags, at the end of the document, etc).
<html> <head> <title>Lazy Load Example</title> <%= init_tinymce_hammer_if_required %> </head> ...
The method above will insert a pair of script tags whenever there is a TinyMCE editor on the page. It knows to do this anytime you use one of the 3 basic helpers. Each of these helpers behave exactly like their text_area cousins. They even accept the same parameters.
<%= tinymce_tag('comment', 'Your comment goes here ...') %>
<%= tinymce(:comment, :body) %>
<%- form_for @comment do |form| -%> <%= form.label :body %> <%= form.tinymce :body %> <% end %>
Now that you are up and running you probably want to customize how the TinyMCE editor looks and acts for your website.