Topic: Attach tinyMCE to specific text area

Hey Guys,

I am new to rails, so bear with me as I explain the situation.

I installed the TinyMCE plugin. It creates all text_area into an WYSIWYG editor. How can I only attach it to specific text areas I want rather than all. Or the flipside would be: How can I remove the text editor from certain text area.

Thanks in advance.

Re: Attach tinyMCE to specific text area

You can 'bind' the tinyMCE to specific textareas. There are several things to do, most of them you probably did already:

1. Ensure tinyMCE initialization in the controller

  # prepare initialization for tinymce editor

2. in the configuration part for tinyMCE (in my application I did it in the view):
<%= include_tiny_mce_if_needed( {:language => I18n.locale,
:editor_selector => 'simpleEditorConfig',
:theme => 'simple',
:encoding => 'xml',
:verify_html => true, :cleanup => true,
:mode => 'specific_textareas', :browsers => %w{msie gecko} } ) %>

3. in the textarea definition
<%= faq_form.text_area    :answer, :cols => 70, 
:rows => 7, :class => "simpleEditorConfig" %>

It's important that the tinyMCE configuration-parameter :editor_selector has the same value as the class-parameter of your textarea.

cheers, rainer