diff options
| author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-22 16:50:26 -0700 | 
|---|---|---|
| committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-22 16:55:27 -0700 | 
| commit | 28dbeb3a643eeb35767df55ed579f54438c3ee18 (patch) | |
| tree | 67d8e6dfa2d4fc7a7811175a3250ef8ff5bd8bba | |
| parent | 63ed43cb9901cc7adc352a51fa256c3ba7b6637f (diff) | |
| download | rails-28dbeb3a643eeb35767df55ed579f54438c3ee18.tar.gz rails-28dbeb3a643eeb35767df55ed579f54438c3ee18.tar.bz2 rails-28dbeb3a643eeb35767df55ed579f54438c3ee18.zip | |
Get controller/render_other_test.rb to pass on new base and fixed a bug in new base with regards to rendering layouts.
| -rw-r--r-- | actionpack/lib/action_controller/abstract/layouts.rb | 2 | ||||
| -rw-r--r-- | actionpack/lib/action_view/template/template.rb | 3 | ||||
| -rw-r--r-- | actionpack/test/controller/render_other_test.rb | 14 | 
3 files changed, 14 insertions, 5 deletions
| diff --git a/actionpack/lib/action_controller/abstract/layouts.rb b/actionpack/lib/action_controller/abstract/layouts.rb index b3b743d6e8..8721e5f4dc 100644 --- a/actionpack/lib/action_controller/abstract/layouts.rb +++ b/actionpack/lib/action_controller/abstract/layouts.rb @@ -85,7 +85,7 @@ module AbstractController        end        begin -        _layout_for_name(_layout) if _action_has_layout? +        _layout_for_name(_layout, details) if _action_has_layout?        rescue NameError => e          raise NoMethodError,             "You specified #{@_layout.inspect} as the layout, but no such method was found" diff --git a/actionpack/lib/action_view/template/template.rb b/actionpack/lib/action_view/template/template.rb index d58f4ec19e..f61dd591a5 100644 --- a/actionpack/lib/action_view/template/template.rb +++ b/actionpack/lib/action_view/template/template.rb @@ -15,11 +15,12 @@ module ActionView        @handler    = handler        @details    = details -      format = details[:format] || begin +      format = details.delete(:format) || begin          # TODO: Clean this up          handler.respond_to?(:default_format) ? handler.default_format.to_sym.to_s : "html"        end        @mime_type = Mime::Type.lookup_by_extension(format.to_s) +      @details[:formats] = Array.wrap(format && format.to_sym)      end      def render(view, locals, &blk) diff --git a/actionpack/test/controller/render_other_test.rb b/actionpack/test/controller/render_other_test.rb index 3c52b7036d..05645e47fa 100644 --- a/actionpack/test/controller/render_other_test.rb +++ b/actionpack/test/controller/render_other_test.rb @@ -4,6 +4,7 @@ require 'pathname'  class TestController < ActionController::Base    protect_from_forgery +  layout :determine_layout    module RenderTestHelper      def rjs_helper_method_from_module @@ -113,9 +114,16 @@ private    def determine_layout      case action_name -      when "render_js_with_explicit_template", -           "render_js_with_explicit_action_template", -           "delete_with_js", "update_page", "update_page_with_instance_variables" +      when "hello_world", "layout_test", "rendering_without_layout", +           "rendering_nothing_on_layout", "render_text_hello_world", +           "render_text_hello_world_with_layout", +           "hello_world_with_layout_false", +           "partial_only", "partial_only_with_layout", +           "accessing_params_in_template", +           "accessing_params_in_template_with_layout", +           "render_with_explicit_template", +           "render_with_explicit_string_template", +           "update_page", "update_page_with_instance_variables"          "layouts/standard"        when "action_talk_to_layout", "layout_overriding_layout" | 
