diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-20 00:02:02 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-20 00:02:02 +0000 |
commit | acb3d2cf755d6be35527d2ece57a5de415bb6cab (patch) | |
tree | c61b156c3eaaf4f92ba5dd8c1a3e5c16207bd076 | |
parent | cf6d77600ac132fd3f840c8e57d8e139da39f675 (diff) | |
download | rails-acb3d2cf755d6be35527d2ece57a5de415bb6cab.tar.gz rails-acb3d2cf755d6be35527d2ece57a5de415bb6cab.tar.bz2 rails-acb3d2cf755d6be35527d2ece57a5de415bb6cab.zip |
Fixed internal calling
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@707 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | actionpack/lib/action_controller/components.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/components_test.rb | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/components.rb b/actionpack/lib/action_controller/components.rb index 0d17d51ef8..148f7b9119 100644 --- a/actionpack/lib/action_controller/components.rb +++ b/actionpack/lib/action_controller/components.rb @@ -17,7 +17,7 @@ module ActionController #:nodoc: 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) diff --git a/actionpack/test/controller/components_test.rb b/actionpack/test/controller/components_test.rb index 36f15d8df5..7ad3108dd7 100644 --- a/actionpack/test/controller/components_test.rb +++ b/actionpack/test/controller/components_test.rb @@ -17,6 +17,14 @@ class CallerController < ActionController::Base 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 @@ class RenderTest < Test::Unit::TestCase 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
\ No newline at end of file |