Informacion original en http://github.com/kete/tiny_mce
Instalar el gem:
sudo gem install kete-tiny_mce
Add this to config/environment.rb of your Rails application:
config.gem ‘kete-tiny_mce’, :lib => ‘tiny_mce’, :source => ‘gems.github.com‘
Se agrega al controller:
uses_tiny_mce
ptions => {
:theme => ‘advanced’,
:theme_advanced_resizing => true,
:theme_advanced_resize_horizontal => true,
:plugins => %w{safari spellchecker pagebreak style layer table save advhr advimage advlink emotions iespell inlinepopups insertdatetime preview media searchreplace print contextmenu paste directionality fullscreen noneditable visualchars nonbreaking xhtmlxtras template imagemanager filemanager },
:theme_advanced_buttons1 => %w{save newdocument | bold italic underline strikethrough | justifyleft justifycenter justifyright justifyfull | styleselect formatselect fontselect fontsizeselect},
:theme_advanced_buttons2 => %w{cut copy paste pastetext pasteword | search replace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image cleanup help code | insertdate inserttime preview | forecolor backcolor},
:theme_advanced_buttons3 => %w{tablecontrols | hr removeformat visualaid | sub sup | charmap emotions iespell media advhr | print | ltr rtl | fullscreen},
:theme_advanced_buttons4 => %w{insertlayer moveforward movebackward absolute | styleprops spellchecker | cite abbr acronym del ins attribs | visualchars nonbreaking template blockquote pagebreak | insertfile insertimage},
:theme_advanced_toolbar_location => ‘top’,
:theme_advanced_toolbar_align => ‘left’,
:theme_advanced_statusbar_location => ‘bottom’,
:theme_advanced_resizing => true
},
nly => [:new, :create, :edit, :update]
Y a la form en el view se agrega:
:class => “mceEditor”
Y por ultimo se agrega al <head> del application view:
<%= include_tiny_mce_if_needed %>
Documentacion de opciones en:
http://tinymce.moxiecode.com/examples/example_01.php