I’m currently building a small CMS for a client, with Ruby on Rails 2.3.8 and i’m using the rails-ckeditor plugin. I had a lot of these deprecation warnings :
DEPRECATION WARNING: ActionView::SafeBuffer is deprecated! Use ActiveSupport::SafeBuffer instead. (called from local_constants at /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/module/introspection.rb:74)
Like, 170 of them on a single page load… So i googled this error and found some things that suggested to comment out this part of the code :
include ActionView
module ActionView::Helpers::AssetTagHelper
alias_method :rails_javascript_include_tag, :javascript_include_tag
# <%= javascript_include_tag :defaults, :ckeditor %>
def javascript_include_tag(*sources)
main_sources, application_source = [], []
if sources.include?(:ckeditor)
sources.delete(:ckeditor)
sources.push('ckeditor/ckeditor')
end
unless sources.empty?
main_sources = rails_javascript_include_tag(*sources).split("\n")
application_source = main_sources.pop if main_sources.last.include?('application.js')
end
[main_sources.join("\n"), application_source].join("\n")
end
end
So i did that. And i also needed to go into my layouts that included ckeditor and replace this line :
<%= javascript_include_tag :ckeditor %>
With this line, instead :
<%= javascript_include_tag "ckeditor/ckeditor" %>
After restarting my dev mongrel server, that resolved my problem. No more deprecation warnings.
I hope it will help someone else.
Update: it seems that this issue was fixed in the last commit of the rails-ckeditor plugin. So update your plugin and you should be OK now.