diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 5924b240da81fe417a1bad743d5a0c0b0989e893..aa1ddd1a08fcc9dde79fb68431a155f0be54b782 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Added simple alert() notifications for RJS exceptions when config.action_view.debug_rjs = true. [Sam Stephenson] + * Added :content_type option to render, so you can change the content type on the fly [DHH]. Example: render :action => "atom.rxml", :content_type => "application/atom+xml" * CHANGED DEFAULT: The default content type for .rxml is now application/xml instead of type/xml, see http://www.xml.com/pub/a/2004/07/21/dive.html for reason [DHH] diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 95afff0e8457d858eaace6e4a2c1acd5ec2ca2c6..94e7a472329d3df9037e138dabdfd4a1673e40c1 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -162,6 +162,11 @@ class Base # shortly. @@local_assigns_support_string_keys = true cattr_accessor :local_assigns_support_string_keys + + # Specify whether RJS responses should be wrapped in a try/catch block + # that alert()s the caught exception (and then re-raises it). + @@debug_rjs = false + cattr_accessor :debug_rjs @@template_handlers = {} diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb index 1f6aa274dbad322262ef8b391294636ce9630aec..778161218080756ba93c094ee3f2fc79cef45599 100644 --- a/actionpack/lib/action_view/helpers/prototype_helper.rb +++ b/actionpack/lib/action_view/helpers/prototype_helper.rb @@ -370,12 +370,12 @@ def initialize(context, &block) #:nodoc: end private - def include_helpers_from_context - @context.extended_by.each do |mod| - extend mod unless mod.name =~ /^ActionView::Helpers/ + def include_helpers_from_context + @context.extended_by.each do |mod| + extend mod unless mod.name =~ /^ActionView::Helpers/ + end + extend GeneratorMethods end - extend GeneratorMethods - end # JavaScriptGenerator generates blocks of JavaScript code that allow you # to change the content and presentation of multiple DOM elements. Use @@ -425,7 +425,12 @@ def include_helpers_from_context #