lib/remotipart.rb in remotipart-0.2.1 vs lib/remotipart.rb in remotipart-0.3.1
- old
+ new
@@ -1,11 +1,15 @@
module Remotipart
def remotipart_response(options = {}, &block)
- response.content_type = Mime::HTML
content = with_output_buffer(&block)
- text_area_tag('remotipart_response', String.new(content), options)
+ if params[:remotipart_submitted]
+ response.content_type = Mime::HTML
+ text_area_tag('remotipart_response', String.new(content), options)
+ else
+ content
+ end
end
end
class ActionView::Base
include Remotipart
-end
\ No newline at end of file
+end