aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-07-02 16:38:50 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-07-02 16:40:42 +0100
commit2b43620e3c1352028f19550fcde4632d65cbd191 (patch)
treeb28ddcc92eae7fe9ceea11c2f55b1956f5d4efc7 /actionpack/lib/action_controller/base.rb
parent4f75840d72b96fff34d65b59480da7d6c7494120 (diff)
downloadrails-2b43620e3c1352028f19550fcde4632d65cbd191.tar.gz
rails-2b43620e3c1352028f19550fcde4632d65cbd191.tar.bz2
rails-2b43620e3c1352028f19550fcde4632d65cbd191.zip
Add :as option to render a collection of partials with a custom local variable name. [#509 state:resolved] [Simon Jefford, Pratik Naik]
Diffstat (limited to 'actionpack/lib/action_controller/base.rb')
-rwxr-xr-xactionpack/lib/action_controller/base.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index a7b2f147e8..209cdfa686 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -702,6 +702,9 @@ module ActionController #:nodoc:
# # builds the complete response.
# render :partial => "person", :collection => @winners
#
+ # # Renders a collection of partials but with a custom local variable name
+ # render :partial => "admin_person", :collection => @winners, :as => :person
+ #
# # Renders the same collection of partials, but also renders the
# # person_divider partial between each person partial.
# render :partial => "person", :collection => @winners, :spacer_template => "person_divider"
@@ -889,7 +892,7 @@ module ActionController #:nodoc:
if collection = options[:collection]
render_for_text(
@template.send!(:render_partial_collection, partial, collection,
- options[:spacer_template], options[:locals]), options[:status]
+ options[:spacer_template], options[:locals], options[:as]), options[:status]
)
else
render_for_text(