From 7ece0e166d7e65eeaeca5138b7ef0353c598bf95 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 9 Mar 2005 15:26:36 +0000 Subject: Added render_partial/render_partial_collection from controllers for easier Ajaxing git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@880 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/base.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/lib/action_controller/base.rb') diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index e75df4c127..688ab7e174 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -476,6 +476,16 @@ module ActionController #:nodoc: add_variables_to_assigns @template.render_file(template_name) end + + def render_partial(partial_path, object = nil, local_assigns = {}) #:doc: + add_variables_to_assigns + render_text(@template.render_partial(partial_path, object, local_assigns)) + end + + def render_partial_collection(partial_name, collection, partial_spacer_template = nil, local_assigns = {})#:doc: + add_variables_to_assigns + render_text(@template.render_collection_of_partials(partial_name, collection, partial_spacer_template, local_assigns)) + end # Sends the file by streaming it 4096 bytes at a time. This way the # whole file doesn't need to be read into memory at once. This makes -- cgit v1.2.3