tinymce in ajax call - how to get contents
        Posted  
        
            by haries
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by haries
        
        
        
        Published on 2009-10-28T05:49:31Z
        Indexed on 
            2010/06/09
            7:02 UTC
        
        
        Read the original article
        Hit count: 270
        
ruby-on-rails
|tinymce
this is what I have in my view:
<%  form_remote_tag :url => { :controller => 'comments', :action => "create", :post_id => "#{@post.id}"}, :html => {:id => 'comment_form' },
      :before => "tinyMCE.triggerSave(true,true);" do %>
    <%=  label_tag 'Comment' %><br/>
    <%= text_area_tag :comment_body, nil,:rows => 10, :cols => 100 %><br/>
   <p style="margin-top: 10px;">
      <%= submit_tag 'Add',:id => 'btnCommentSave' %>
    </p>
  <% end %>
Tinymce editor is displayed properly.
In my controller: how to get the contents of the text area? I am expecting the contents in params[:comment_body] and I am not seeing it?
I tried doing this also,
 $('#btnCommentSave').click( function(){
    tinyMCE.triggerSave(true,true);
    $('#comment_form').submit();
});
What am I missing? Thanks
© Stack Overflow or respective owner