diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-18 21:17:14 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-18 21:17:14 +0000 |
commit | cc6e8ae57a4a886d68cfa95829fcb7a65a273cab (patch) | |
tree | 8c08cf15e86164cc301472fbb86b214b10cba827 /actionpack/lib | |
parent | 3257a4b9b0081d0f86d630aeb107d8334730bb79 (diff) | |
download | rails-cc6e8ae57a4a886d68cfa95829fcb7a65a273cab.tar.gz rails-cc6e8ae57a4a886d68cfa95829fcb7a65a273cab.tar.bz2 rails-cc6e8ae57a4a886d68cfa95829fcb7a65a273cab.zip |
Removed XML argument style for respond_to, so type.xml(object.to_xml) no longer works -- it wasnt worth the exception
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3944 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/mime_responds.rb | 16 | ||||
-rw-r--r-- | actionpack/lib/action_view/base.rb | 2 |
2 files changed, 6 insertions, 12 deletions
diff --git a/actionpack/lib/action_controller/mime_responds.rb b/actionpack/lib/action_controller/mime_responds.rb index d492b6c258..4dad2c96d2 100644 --- a/actionpack/lib/action_controller/mime_responds.rb +++ b/actionpack/lib/action_controller/mime_responds.rb @@ -18,8 +18,7 @@ module ActionController #:nodoc: DEFAULT_BLOCKS = { :html => 'Proc.new { render }', :js => 'Proc.new { render :action => "#{action_name}.rjs" }', - :xml => 'Proc.new { render :action => "#{action_name}.rxml" }', - :xml_arg => 'Proc.new { render :xml => __mime_responder_arg__ }' + :xml => 'Proc.new { render :action => "#{action_name}.rxml" }' } def initialize(block_binding) @@ -29,7 +28,7 @@ module ActionController #:nodoc: @responses = {} end - def custom(mime_type, *args, &block) + def custom(mime_type, &block) mime_type = mime_type.is_a?(Mime::Type) ? mime_type : Mime::Type.lookup(mime_type.to_s) @order << mime_type @@ -37,19 +36,14 @@ module ActionController #:nodoc: if block_given? @responses[mime_type] = block else - if argument = args.first - eval("__mime_responder_arg__ = #{argument.is_a?(String) ? argument.inspect : argument}", @block_binding) - @responses[mime_type] = eval(DEFAULT_BLOCKS[(mime_type.to_sym.to_s + "_arg").to_sym], @block_binding) - else - @responses[mime_type] = eval(DEFAULT_BLOCKS[mime_type.to_sym], @block_binding) - end + @responses[mime_type] = eval(DEFAULT_BLOCKS[mime_type.to_sym], @block_binding) end end for mime_type in %w( all html js xml rss atom yaml ) eval <<-EOT - def #{mime_type}(argument = nil, &block) - custom(Mime::#{mime_type.upcase}, argument, &block) + def #{mime_type}(&block) + custom(Mime::#{mime_type.upcase}, &block) end EOT end diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index b118ee1042..dff5a365d4 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -218,7 +218,7 @@ module ActionView #:nodoc: # it's relative to the template_root, otherwise it's absolute. The hash in <tt>local_assigns</tt> # is made available as local variables. def render_file(template_path, use_full_path = true, local_assigns = {}) - @first_render = template_path if @first_render.nil? + @first_render = template_path if @first_render.nil? if use_full_path template_path_without_extension, template_extension = path_and_extension(template_path) |