Permalink
Browse files

Only call html_safe! if it's supported

  • Loading branch information...
1 parent a406694 commit c8a48c2d59c61fc4bfd64724a201c44bb640c133 @mjonuschat mjonuschat committed Jun 6, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/formtastic/util.rb
View
@@ -13,7 +13,8 @@ module Util
def html_safe(text)
return text if text.nil?
return text.html_safe if defined?(ActiveSupport::SafeBuffer)
- return text.html_safe!
+ return text.html_safe! if text.respond_to?(:html_safe!)
+ text
end
def rails_safe_buffer_class

0 comments on commit c8a48c2

Please sign in to comment.