Permalink
Browse files

Refactoring on Formtastic::Util.html_safe

  • Loading branch information...
1 parent 60ceac2 commit 457b09849f5fb6bfd3db56536bfff77930445018 @sobrinho sobrinho committed Jan 20, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/formtastic/util.rb
@@ -14,9 +14,11 @@ module Util
# @param text [String]
# @return [String] `text`, marked as HTML-safe
def html_safe(text)
- return text if text.nil?
- return text.html_safe
- text
+ if text.respond_to?(:html_safe)
+ text.html_safe
+ else
+ text
+ end
end
end

0 comments on commit 457b098

Please sign in to comment.