Changeset 707
- Timestamp:
- 02/20/05 00:02:02 (4 years ago)
- Files:
-
- trunk/actionpack/lib/action_controller/components.rb (modified) (1 diff)
- trunk/actionpack/test/controller/components_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_controller/components.rb
r706 r707 18 18 19 19 def component_class(options) 20 options[:controller] ? (options[:controller].camelize + "Controller").constantize : self 20 options[:controller] ? (options[:controller].camelize + "Controller").constantize : self.class 21 21 end 22 22 trunk/actionpack/test/controller/components_test.rb
r706 r707 16 16 def calling_from_template 17 17 render_template "Ring, ring: <%= render_component(:controller => 'callee', :action => 'being_called') %>" 18 end 19 20 def internal_caller 21 render_template "Are you there? <%= render_component(:action => 'internal_callee') %>" 22 end 23 24 def internal_callee 25 render_text "Yes, ma'am" 18 26 end 19 27 … … 59 67 assert_equal "Ring, ring: Lady of the House, speaking", @response.body 60 68 end 69 70 def test_internal_calling 71 get :internal_caller 72 assert_equal "Are you there? Yes, ma'am", @response.body 73 end 61 74 end