diff --git a/lib/template_streaming.rb b/lib/template_streaming.rb index 11f964b..a8507d0 100644 --- a/lib/template_streaming.rb +++ b/lib/template_streaming.rb @@ -38,8 +38,8 @@ def action_streams? end def render_with_template_streaming(*args, &block) - options = args.first { |a| a.is_a?(Hash) } - if options && options.size == 1 && options.key?(:stream) + options = args.last.is_a?(Hash) ? args.last : {} + if options.key?(:stream) # Need to set the default values, since the standard #render won't. options[:template] = default_template options[:layout] = true @@ -396,3 +396,4 @@ def pre_process_with_template_streaming(*args, &block) require 'template_streaming/error_recovery' require 'template_streaming/caching' require 'template_streaming/autoflushing' + diff --git a/lib/template_streaming/error_recovery.rb b/lib/template_streaming/error_recovery.rb index 41c2caf..e2d4729 100644 --- a/lib/template_streaming/error_recovery.rb +++ b/lib/template_streaming/error_recovery.rb @@ -192,7 +192,7 @@ def render_with_template_streaming_error_recovery(*args, &block) controller.streaming_error_callbacks.each{|c| c.call(e)} exceptions = controller.request.env[EXCEPTIONS_KEY] and exceptions << e - '' + '">' end else render_without_template_streaming_error_recovery(*args, &block)