Permalink
Browse files

Fixed internal calling

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@707 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
dhh committed Feb 20, 2005
1 parent cf6d776 commit acb3d2cf755d6be35527d2ece57a5de415bb6cab
Showing with 14 additions and 1 deletion.
  1. +1 −1 actionpack/lib/action_controller/components.rb
  2. +13 −0 actionpack/test/controller/components_test.rb
@@ -17,7 +17,7 @@ def component_response(options)
end
def component_class(options)
- options[:controller] ? (options[:controller].camelize + "Controller").constantize : self
+ options[:controller] ? (options[:controller].camelize + "Controller").constantize : self.class
end
def component_request(options)
@@ -17,6 +17,14 @@ def calling_from_template
render_template "Ring, ring: <%= render_component(:controller => 'callee', :action => 'being_called') %>"
end
+ def internal_caller
+ render_template "Are you there? <%= render_component(:action => 'internal_callee') %>"
+ end
+
+ def internal_callee
+ render_text "Yes, ma'am"
+ end
+
def rescue_action(e) raise end
end
@@ -58,4 +66,9 @@ def test_calling_from_template
get :calling_from_template
assert_equal "Ring, ring: Lady of the House, speaking", @response.body
end
+
+ def test_internal_calling
+ get :internal_caller
+ assert_equal "Are you there? Yes, ma'am", @response.body
+ end
end

0 comments on commit acb3d2c

Please sign in to comment.