aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2019-01-28 14:40:30 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2019-01-28 14:40:30 -0800
commit793455e594dc98ea026c7665dd0de3ae8829cf73 (patch)
tree119fe20352b0f86932dfcaae1d80389cad2c4570 /actionview
parente98b51300ab1c58b790cbaf9a27bd277184579ac (diff)
downloadrails-793455e594dc98ea026c7665dd0de3ae8829cf73.tar.gz
rails-793455e594dc98ea026c7665dd0de3ae8829cf73.tar.bz2
rails-793455e594dc98ea026c7665dd0de3ae8829cf73.zip
Remove default parameters from method signature
This method is private, and we always pass something in.
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/renderer/template_renderer.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/actionview/lib/action_view/renderer/template_renderer.rb b/actionview/lib/action_view/renderer/template_renderer.rb
index 6a50ccff7f..c36baeffcd 100644
--- a/actionview/lib/action_view/renderer/template_renderer.rb
+++ b/actionview/lib/action_view/renderer/template_renderer.rb
@@ -12,7 +12,7 @@ module ActionView
@lookup_context.rendered_format ||= (template.formats.first || formats.first)
- render_template(context, template, options[:layout], options[:locals])
+ render_template(context, template, options[:layout], options[:locals] || {})
end
private
@@ -45,9 +45,7 @@ module ActionView
# Renders the given template. A string representing the layout can be
# supplied as well.
- def render_template(view, template, layout_name = nil, locals = nil)
- locals ||= {}
-
+ def render_template(view, template, layout_name, locals)
render_with_layout(view, layout_name, locals) do |layout|
instrument(:template, identifier: template.identifier, layout: layout.try(:virtual_path)) do
template.render(view, locals) { |*name| view._layout_for(*name) }