Permalink
Browse files

fixed issue #516

  • Loading branch information...
Didier Lafforgue
Didier Lafforgue committed Sep 24, 2012
1 parent afdd520 commit 8c11524d32fbb8ebe09723b7ab1e528e0f80fdf0
View
@@ -33,7 +33,7 @@ PATH
rails (~> 3.2.8)
rails-backbone (~> 0.6.1)
rake (~> 0.9.2)
- responders (~> 0.6.4)
+ responders (~> 0.9.2)
rmagick (~> 2.12.2)
sanitize (~> 2.0.3)
unidecoder (~> 1.1.1)
@@ -263,7 +263,8 @@ GEM
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
- responders (0.6.5)
+ responders (0.9.2)
+ railties (~> 3.1)
rmagick (2.12.2)
rspec (2.8.0)
rspec-core (~> 2.8.0)
@@ -58,7 +58,8 @@ def with_flash_message(type = :notice, in_header = true)
message = controller.flash[type]
unless message.blank?
- controller.headers['X-Message'] = message
+ # controller.headers['X-Message'] = message
+ controller.headers['X-Message'] = ActiveSupport::JSON::Encoding.escape(message)
controller.headers['X-Message-Type'] = type.to_s
end
View
@@ -45,7 +45,7 @@ Gem::Specification.new do |s|
s.add_dependency 'locomotive_liquid', '~> 2.2.3'
s.add_dependency 'formtastic', '~> 2.0.2'
- s.add_dependency 'responders', '~> 0.6.4'
+ s.add_dependency 'responders', '~> 0.9.2'
s.add_dependency 'cells', '~> 3.8.0'
s.add_dependency 'RedCloth', '~> 4.2.8'
s.add_dependency 'sanitize', '~> 2.0.3'
@@ -102,7 +102,7 @@
var noticeType = xhr.getResponseHeader('X-Message-Type');
if (noticeType != null) {
var growlType = noticeType == 'notice' ? 'notice' : 'alert'; // for now, only 2 kind of growl messages
- $.growl(noticeType, xhr.getResponseHeader('X-Message'));
+ $.growl(noticeType, jQuery.parseJSON(xhr.getResponseHeader('X-Message')));
}
}

0 comments on commit 8c11524

Please sign in to comment.