TinyMCE with Ajax in Rails

Tagged with TinyMCE Rails Ajax

Language: Ruby

In order to get TinyMCE to work with Ajax calls, you need to tell the plugin to save the contents prior to making the post. This code demonstrates how you would do that.

View as text

<% form_remote_tag :url => whatever, :before => "tinyMCE.triggerSave(true,true)" do %>
   <%= text_area :object, :method, :class => "mceEditor" %>
   <%= submit_tag "save" %>
<% end %>
Original snippet written by Kevin Gisi
Last updated at 13:24 PM on Apr 04, 2009

SnippetStash costs money to host and develop. The service is free for everyone to use
but if you found it useful please consider making a small donation.