Итак, открываем файл vendor/plugins/auto_admin/lib/auto_admin_simple_theme.rb и пишем перед def static_image
def fck_textarea(field, options = {})
value = eval("@object.#{field}")
value = value.nil? ? "" : value
id = "#{@object_name}_#{field}_editor"
cols = options[:cols].nil? ? '' : "cols='"+options[:cols]+"'"
rows = options[:rows].nil? ? '' : "rows='"+options[:rows]+"'"
width = options[:width].nil? ? '100%' : options[:width]
height = options[:height].nil? ? '100%' : options[:height]
toolbarSet = options[:toolbarSet].nil? ? 'Default' : options[:toolbarSet]
base_path = '/javascripts/fckeditor/'
inputs =
"<textarea id='#{id}' #{cols} #{rows} name='#{@object_name}[#{field}]'>#{value}</textarea>\n"+
"<script>var oFCKeditor = new FCKeditor('#{id}', '#{width}', '#{height}', '#{toolbarSet}');\n"+
"oFCKeditor.BasePath = \"#{base_path}\"\n"+
"oFCKeditor.Config['CustomConfigurationsPath'] = '../../fckcustom.js';\n"+
"oFCKeditor.ReplaceTextarea();\n</script>"
return inputs
end
Использовать примерно так:
b.fck_textarea :description, {:toolbarSet => 'Simple', :width => '100%', :height => '300px'}
Код конечно написан в стиле fast and dirty но работает.