mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Aligned the order of the arguments of render_template and render_with_layout
This commit is contained in:
parent
3296dc2589
commit
c546f9040e
1 changed files with 2 additions and 2 deletions
|
@ -49,14 +49,14 @@ module ActionView
|
||||||
# Renders the given template. A string representing the layout can be
|
# Renders the given template. A string representing the layout can be
|
||||||
# supplied as well.
|
# supplied as well.
|
||||||
def render_template(view, template, layout_name, locals)
|
def render_template(view, template, layout_name, locals)
|
||||||
render_with_layout(view, layout_name, template, locals) do |layout|
|
render_with_layout(view, template, layout_name, locals) do |layout|
|
||||||
instrument(:template, identifier: template.identifier, layout: layout.try(:virtual_path)) do
|
instrument(:template, identifier: template.identifier, layout: layout.try(:virtual_path)) do
|
||||||
template.render(view, locals) { |*name| view._layout_for(*name) }
|
template.render(view, locals) { |*name| view._layout_for(*name) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_with_layout(view, path, template, locals)
|
def render_with_layout(view, template, path, locals)
|
||||||
layout = path && find_layout(path, locals.keys, [formats.first])
|
layout = path && find_layout(path, locals.keys, [formats.first])
|
||||||
content = yield(layout)
|
content = yield(layout)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue