diff options
author | Akira Matsuda <ronnie@dio.jp> | 2010-12-25 23:54:34 +0900 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-02-01 13:01:54 -0200 |
commit | 5dd803e9b1149f8e6d7de787e0c833c94f48d5a4 (patch) | |
tree | 1704319e94fad632bf807e8ad3c203862b782ee0 /actionpack/lib/action_view/renderer | |
parent | 6bd9fac1e301d57765073e1f7a17e46972428205 (diff) | |
download | rails-5dd803e9b1149f8e6d7de787e0c833c94f48d5a4.tar.gz rails-5dd803e9b1149f8e6d7de787e0c833c94f48d5a4.tar.bz2 rails-5dd803e9b1149f8e6d7de787e0c833c94f48d5a4.zip |
Accept String value for render_partial :as option
[#6222 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'actionpack/lib/action_view/renderer')
-rw-r--r-- | actionpack/lib/action_view/renderer/partial_renderer.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/renderer/partial_renderer.rb b/actionpack/lib/action_view/renderer/partial_renderer.rb index 3fdea23a4a..94c0a8a8fb 100644 --- a/actionpack/lib/action_view/renderer/partial_renderer.rb +++ b/actionpack/lib/action_view/renderer/partial_renderer.rb @@ -108,7 +108,7 @@ module ActionView locals << @variable_counter if @collection find_template(path, locals) end - end + end def find_template(path=@path, locals=@locals.keys) prefixes = path.include?(?/) ? [] : @view.controller_prefixes @@ -159,7 +159,7 @@ module ActionView end def retrieve_variable(path) - variable = @options[:as] || path[%r'_?(\w+)(\.\w+)*$', 1].to_sym + variable = @options[:as].try(:to_sym) || path[%r'_?(\w+)(\.\w+)*$', 1].to_sym variable_counter = :"#{variable}_counter" if @collection [variable, variable_counter] end |