aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-03-09 15:26:36 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-03-09 15:26:36 +0000
commit7ece0e166d7e65eeaeca5138b7ef0353c598bf95 (patch)
tree94e054eefe3564b457e956a8baa8cfaf35fc638a /actionpack/lib/action_controller/base.rb
parent5a4846a0d385b54e8ba1c974bf8c4de29fb49ea5 (diff)
downloadrails-7ece0e166d7e65eeaeca5138b7ef0353c598bf95.tar.gz
rails-7ece0e166d7e65eeaeca5138b7ef0353c598bf95.tar.bz2
rails-7ece0e166d7e65eeaeca5138b7ef0353c598bf95.zip
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
Diffstat (limited to 'actionpack/lib/action_controller/base.rb')
-rwxr-xr-xactionpack/lib/action_controller/base.rb10
1 files changed, 10 insertions, 0 deletions
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