Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #316 from stuartc/cdata_tags

issue when HTML parsers would try and validate or test on the HTML tags
  • Loading branch information...
commit 4f7e92a0e5d3a9b336051b1820a039afcca8fe22 2 parents 548b491 + 3e3503b
Brian Cardarella bcardarella authored
3  lib/client_side_validations/action_view/form_helper.rb
View
@@ -95,9 +95,8 @@ def client_side_form_settings(object, options)
end
content_tag(:script) do
- "window.ClientSideValidations.forms['#{var_name}'] = #{builder.client_side_form_settings(options, self).merge(:validators => 'validator_hash').to_json};".html_safe
+ "//<![CDATA[\nwindow.ClientSideValidations.forms['#{var_name}'] = #{builder.client_side_form_settings(options, self).merge(:validators => 'validator_hash').to_json};\n//]]>".html_safe
end
-
end
end
2  test/action_view/cases/helper.rb
View
@@ -145,7 +145,7 @@ def whole_form(action = "http://www.example.com", id = nil, html_class = nil, op
end
def build_script_tag(html, id, validators)
- (html || "") + %Q{<script>window.ClientSideValidations.forms['#{id}'] = #{client_side_form_settings_helper.merge(:validators => validators).to_json};</script>}
+ (html || "") + %Q{<script>//<![CDATA[\nwindow.ClientSideValidations.forms['#{id}'] = #{client_side_form_settings_helper.merge(:validators => validators).to_json};\n//]]></script>}
end
protected
Please sign in to comment.
Something went wrong with that request. Please try again.