Post Meta

Bookmarks

  • Delicious
  • Digg
  • Reddit
  • Magnolia
  • Newsvine
  • Furl
  • Facebook
  • Technorati

It seems to be easy following these instructions.

[UPDATE]

I can’t really make it to work on my site, I’m getting that strange “this.getDoc() has no properties” errors when creating a new record, and, sometimes when updating a record my entire layout will be messed up. I think I’ll step back and use a less-rich editor which works fine w. ActiveScaffold.

[/UPDATE]

This was the post which helped me out definitely.

I’m using TinyMCE with ActiveScaffold only for textareas having the “tiny_mce” class added. And the TinyMCE library is loaded only when necessary, only on pages which will use it.

There you are with the complete instructions.

  1. Install the plugin following these instructions. On use_tiny_mce init section after :theme_advanced_buttons3 => [], add the textarea selector whereTinyMCE will be used: ” :editor_selector => “tiny_mce”,
  2. Hack ActiveScaffold following these instructions.
  3. Finally, override ActiveScaffold’s form display in the helper associated to the form. The general howto is here, the code snippet is the following:
1
2
3
4
 
def ro_form_column(record, input_name)
text_area :record, :ro, :name  =>  input_name, :class  =>  :tiny_mce, :style  =>  "width:450px;"
end

Credits goes to:

  • John Wulff
  • Walksalong and Bill Garr


Related posts

  1. Gravatar

    Thanks very much for the instructions… I just happened to be trying to integrate TineMCE with ActiveScaffold today and what good luck to find someone solving the problem at the same time!

    I did have some trouble with the “uses_tiny_mce” configuration listed in the plugin installation instructions. Here’s the configuration that worked for me:
    uses_tiny_mce(:options => {
    :mode => “textareas”,
    :theme => “advanced”,
    :theme_advanced_buttons1 => “formatselect,bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,indent,outdent,separator,bullist,numlist,link,unlink,image,undo,redo”,
    :theme_advanced_buttons2 => “”,
    :theme_advanced_buttons3 => “”,
    :editor_selector => “tiny_mce”,
    :theme_advanced_toolbar_location => “top”,
    :theme_advanced_toolbar_align => “left”,
    :theme_advanced_statusbar_location => “bottom”,
    :extended_valid_elements => “a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]”
    })

    02 / 19 / 05:17
  2. Gravatar

    Thanx u very much.Your blog helped me much for my application.

    06 / 24 / 08:21

Leave A Comment

+ -