lib/formtastic/util.rb in formtastic-rails3-0.9.10.1 vs lib/formtastic/util.rb in formtastic-rails3-1.0.0.beta3
- old
+ new
@@ -11,11 +11,12 @@
# @param text [String]
# @return [String] `text`, marked as HTML-safe
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
# It's important that we check ActiveSupport first,
# because in Rails 2.3.6 ActionView::SafeBuffer exists
@@ -27,9 +28,9 @@
def rails3?
version=
if defined?(ActionPack::VERSION::MAJOR)
ActionPack::VERSION::MAJOR
end
- version >= 3
+ !version.blank? && version >= 3
end
end
end