Integrating a Rich Text Editor into Active Scaffold
To speed up development times we often use Active Scaffold (AS) to help with our backend functionality. AS unfortunately doesn't come with a built in editor therefore we needed to integrate a WYSIWYG into it.
After a little google'in we found FCK Editor which is an impressive, well known and well managed WYSIWYG editor.
After a little tweaking in both AS and FCK editor this became the perfect solution.
The below shows the steps needed to integrate FCK Editor into Active Scaffold (Rails 2.3.2)
1) Once you have installed the easy-fckeditor plugin you need to run
1 rake fckeditor:install
2) Then include the FCK Editor Javascript into your layout
1 <%= javascript_include_tag :fckeditor %>
3) Include the following into the relevant controller
1 config.create.multipart = true 2 config.update.multipart = true
4) Config the form column in the helpers to display the FCK Editor (replace txt_area with your relevant column name)
1 def txt_area_form_column(record, input_name) 2 fckeditor_textarea(:record, :txt_area, :toolbarSet => 'Default', :name=> input_name, :width => "740px", :height => "200px") 3 end 4 5 def txt_area_column(record) 6 sanitize(record.txt_area) 7 end
And thats it you should now be the proud owner of a WYSIWYG Editor in you ruby on rails application.

