mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fixed internal calling
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@707 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
cf6d77600a
commit
acb3d2cf75
2 changed files with 14 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
Loading…
Reference in a new issue