I have an article controller that deals with articles.
I have a comment model that belongs_to: article and my article model :has_many comments.
I have initialized tinymce in my articles controller with
uses_tiny_mce :options => {
:theme => 'advanced', :theme_advanced_resizing => false, :theme_advanced_resize_horizontal => false,
:theme_advanced_toolbar_location => "top", #:plugins => "preview",
:theme_advanced_buttons1 => "",
:theme_advanced_buttons1_add => "", :theme_advanced_buttons2 => "", :content_css => "/stylesheets/style_mce.css",
:theme_advanced_buttons3 => ""}, :only => [:show, :new, :create, :edit, :update]
I know the buttons are empty, I am just debugging for now. So tiny mce works fine in my article new and edit views where the tiny_mce textarea is for the article model. In my article show view I have a form for my comments that works perfectly without the body being mceEditor. When I add it, the form does nothing. I click on submit and it does nothing at all.
<%= simple_form_for([@article, @article.comments.build]) do |f| %>
<%= hidden_field_tag :user_id, current_user.id %>
<%= f.input :body, :label => false, :placeholder => "Comment away", :input_html => { :class => "mceEditor" } %>
<%= f.submit %>
<% end %>
When I remove the :class => “mceEditor” it works. When i put it back, the form does nothing when i click on it. The tiny_mce stuff is displayed in the text area but it breaks the form action with no errors. I read over the docs for the tiny_mce gem and it said to put the include for the tiny_mce into the controller that has the action, which is articles, but the model the form in my articles#show view is for comments, so i think the error is something to do with that. Please help!
The easiest way to do this in rails EVER.
<%= f.submit :onclick => “jQuery(tinyMCE.triggerSave())” %>
Tada!