Module: AwesomeNestedFields

Defined in:
lib/awesome_nested_fields.rb,
lib/awesome_nested_fields/engine.rb,
lib/awesome_nested_fields/railtie.rb,
lib/awesome_nested_fields/version.rb,
lib/generators/awesome_nested_fields/install/install_generator.rb

Defined Under Namespace

Modules: Generators Classes: Engine, Railtie

Constant Summary collapse

VERSION =
"0.6.4"

Class Method Summary collapse

Class Method Details

.escape_html_tags(html) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/awesome_nested_fields.rb', line 13

def self.escape_html_tags(html)
  html.gsub(/[&><]/) do |char|
    case char
    when '<' then '&lt;'
    when '>' then '&gt;'
    when '&' then '&amp;'
    end
  end.html_safe
end