aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base/render.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/base/render.rb')
-rw-r--r--actionpack/lib/action_controller/base/render.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/base/render.rb b/actionpack/lib/action_controller/base/render.rb
index 606df58518..52934076e6 100644
--- a/actionpack/lib/action_controller/base/render.rb
+++ b/actionpack/lib/action_controller/base/render.rb
@@ -374,8 +374,13 @@ module ActionController
render_for_file(name.sub(/^\//, ''), [layout, true], options)
end
end
-
+
+ # ==== Arguments
+ # parts<Array[String, Array[Symbol*], String, Boolean]>::
+ # Example: ["show", [:html, :xml], "users", false]
def render_for_parts(parts, layout, options = {})
+ parts[1] = {:formats => parts[1], :locales => [I18n.locale]}
+
tmp = view_paths.find_by_parts(*parts)
layout = _pick_layout(*layout) unless tmp.exempt_from_layout?