Permalink
Browse files

moving html_safe call into helpers directly as they only work from th…

…at level
  • Loading branch information...
1 parent 007db3f commit a6cd35ba68c6d210f097a37ff737bbc1e5c61972 @erikstmartin erikstmartin committed with stefanpenner Jan 26, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 actionpack/lib/action_view/helpers/ajax_helper.rb
@@ -405,7 +405,7 @@ def periodically_call_remote(options = {})
# periodically_call_remote does not need data-observe=true
attributes.delete('data-observe')
- script_decorator(attributes)
+ script_decorator(attributes).html_safe!
end
# Observes the field with the DOM ID specified by +field_id+ and calls a
@@ -484,7 +484,7 @@ def observe_field(name, options = {})
attributes = extract_observer_attributes!(options)
attributes.merge!(html_options) if html_options
- script_decorator(attributes)
+ script_decorator(attributes).html_safe!
end
# Observes the form with the DOM ID specified by +form_id+ and calls a
@@ -499,13 +499,13 @@ def observe_form(name, options = {})
options[:observed] = name
attributes = extract_observer_attributes!(options)
- script_decorator(attributes)
+ script_decorator(attributes).html_safe!
end
def script_decorator(options)
attributes = %w(type="application/json")
attributes += options.map{|k, v| k + '="' + v.to_s + '"'}
- "<script " + attributes.join(" ") + "></script>".html_safe!
+ "<script " + attributes.join(" ") + "></script>"
end
private

0 comments on commit a6cd35b

Please sign in to comment.