Changeset 6507
- Timestamp:
- 04/08/07 17:16:36 (3 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/mime_responds.rb (modified) (1 diff)
- trunk/actionpack/test/controller/mime_responds_test.rb (modified) (1 diff)
- trunk/actionpack/test/fixtures/respond_to/all_types_with_layout.html.erb (moved) (moved from trunk/actionpack/test/fixtures/respond_to/all_types_with_layout.rhtml)
- trunk/actionpack/test/fixtures/respond_to/all_types_with_layout.js.rjs (moved) (moved from trunk/actionpack/test/fixtures/respond_to/all_types_with_layout.rjs)
- trunk/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.html.erb (moved) (moved from trunk/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.rhtml)
- trunk/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.js.rjs (moved) (moved from trunk/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.rjs)
- trunk/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder (moved) (moved from trunk/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.rxml)
- trunk/actionpack/test/fixtures/respond_to/using_defaults.html.erb (moved) (moved from trunk/actionpack/test/fixtures/respond_to/using_defaults.rhtml)
- trunk/actionpack/test/fixtures/respond_to/using_defaults.js.rjs (moved) (moved from trunk/actionpack/test/fixtures/respond_to/using_defaults.rjs)
- trunk/actionpack/test/fixtures/respond_to/using_defaults.xml.builder (moved) (moved from trunk/actionpack/test/fixtures/respond_to/using_defaults.rxml)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r6506 r6507 1 1 *SVN* 2 3 * Change default respond_to templates for xml and rjs formats. [Rick] 4 5 * Default xml template goes from #{action_name}.rxml => #{action_name}.xml.builder. 6 * Default rjs template goes from #{action_name}.rjs => #{action_name}.js.rjs. 2 7 3 8 * Fix WSOD due to modification of a formatted template extension so that requests to templates like 'foo.html.erb' fail on the second hit. [Rick] trunk/actionpack/lib/action_controller/mime_responds.rb
r5232 r6507 108 108 109 109 class Responder #:nodoc: 110 DEFAULT_BLOCKS = [:html, :js, :xml].inject({}) do |blocks, ext| 111 template_extension = (ext == :html ? '' : ".r#{ext}") 112 blocks.update ext => %(Proc.new { render :action => "\#{action_name}#{template_extension}", :content_type => Mime::#{ext.to_s.upcase} }) 113 end 110 default_block_format = %(Proc.new { render :action => "\#{action_name}%s", :content_type => Mime::%s }) 111 DEFAULT_BLOCKS = {} 112 DEFAULT_BLOCKS[:html] = default_block_format % ['', 'HTML'] 113 DEFAULT_BLOCKS[:js] = default_block_format % ['.js.rjs', 'JS'] 114 DEFAULT_BLOCKS[:xml] = default_block_format % ['.xml.builder', 'XML'] 114 115 115 116 def initialize(block_binding) trunk/actionpack/test/controller/mime_responds_test.rb
r6120 r6507 352 352 353 353 get :using_defaults, :format => "xml" 354 assert_equal "using_defaults. rxml", @response.body354 assert_equal "using_defaults.xml.builder", @response.body 355 355 end 356 356 end