aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-04-17 09:25:54 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-04-17 09:25:54 +0000
commite5b3d08a0a10169cc7d482d13d5b5429162206c4 (patch)
treeabda9dacb0b222324f2313a87a23b4917c29c3ab /actionpack/lib/action_controller
parentc3ca5ab7a80702b63dc77748043f8a72ff1529a5 (diff)
downloadrails-e5b3d08a0a10169cc7d482d13d5b5429162206c4.tar.gz
rails-e5b3d08a0a10169cc7d482d13d5b5429162206c4.tar.bz2
rails-e5b3d08a0a10169cc7d482d13d5b5429162206c4.zip
Added that render_partial called from a controller will use the action name as default #828 [Dan Peterson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1182 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rwxr-xr-xactionpack/lib/action_controller/base.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index c8a012afda..15724e2e36 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -489,11 +489,19 @@ module ActionController #:nodoc:
@template.render_file(template_name)
end
- def render_partial(partial_path, object = nil, local_assigns = {}) #:doc:
+ # Renders the partial specified by <tt>partial_path</tt>, which by default is the name of the action itself. Example:
+ #
+ # class WeblogController < ActionController::Base
+ # def show
+ # render_partial # renders "weblog/_show.r(xml|html)"
+ # end
+ # end
+ def render_partial(partial_path = default_template_name, object = nil, local_assigns = {}) #:doc:
add_variables_to_assigns
render_text(@template.render_partial(partial_path, object, local_assigns))
end
+ # Renders a collection of partials using <tt>partial_name</tt> to iterate over the +collection+.
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))