Dont introspect inline templates for the logger and cleanup a few styling issues
This commit is contained in:
parent
36624b2c70
commit
a110ff0fca
|
@ -125,8 +125,8 @@ module AbstractController
|
||||||
if options.key?(:text)
|
if options.key?(:text)
|
||||||
options[:_template] = ActionView::Template::Text.new(options[:text], format_for_text)
|
options[:_template] = ActionView::Template::Text.new(options[:text], format_for_text)
|
||||||
elsif options.key?(:inline)
|
elsif options.key?(:inline)
|
||||||
handler = ActionView::Template.handler_class_for_extension(options[:type] || "erb")
|
handler = ActionView::Template.handler_class_for_extension(options[:type] || "erb")
|
||||||
template = ActionView::Template.new(options[:inline], "inline #{options[:inline].inspect}", handler, {})
|
template = ActionView::Template.new(options[:inline], "inline template", handler, {})
|
||||||
options[:_template] = template
|
options[:_template] = template
|
||||||
elsif options.key?(:template)
|
elsif options.key?(:template)
|
||||||
options[:_template_name] = options[:template]
|
options[:_template_name] = options[:template]
|
||||||
|
@ -194,9 +194,8 @@ module AbstractController
|
||||||
# otherwise, process the parameter into a ViewPathSet.
|
# otherwise, process the parameter into a ViewPathSet.
|
||||||
def view_paths=(paths)
|
def view_paths=(paths)
|
||||||
clear_template_caches!
|
clear_template_caches!
|
||||||
self._view_paths = paths.is_a?(ActionView::PathSet) ?
|
self._view_paths = paths.is_a?(ActionView::PathSet) ? paths : ActionView::Base.process_view_paths(paths)
|
||||||
paths : ActionView::Base.process_view_paths(paths)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -78,12 +78,12 @@ module ActionView
|
||||||
end
|
end
|
||||||
|
|
||||||
def _render_inline(inline, layout, options)
|
def _render_inline(inline, layout, options)
|
||||||
handler = Template.handler_class_for_extension(options[:type] || "erb")
|
handler = Template.handler_class_for_extension(options[:type] || "erb")
|
||||||
template = Template.new(options[:inline],
|
template = Template.new(options[:inline], "inline template", handler, {})
|
||||||
"inline #{options[:inline].inspect}", handler, {})
|
|
||||||
|
|
||||||
locals = options[:locals]
|
locals = options[:locals]
|
||||||
content = template.render(self, locals)
|
content = template.render(self, locals)
|
||||||
|
|
||||||
_render_text(content, layout, locals)
|
_render_text(content, layout, locals)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -91,6 +91,7 @@ module ActionView
|
||||||
content = layout.render(self, locals) do |*name|
|
content = layout.render(self, locals) do |*name|
|
||||||
_layout_for(*name) { content }
|
_layout_for(*name) { content }
|
||||||
end if layout
|
end if layout
|
||||||
|
|
||||||
content
|
content
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -113,21 +114,16 @@ module ActionView
|
||||||
msg
|
msg
|
||||||
end
|
end
|
||||||
|
|
||||||
locals = options[:locals] || {}
|
locals = options[:locals] || {}
|
||||||
|
content = partial ? _render_partial_object(template, options) : template.render(self, locals)
|
||||||
content = if partial
|
|
||||||
_render_partial_object(template, options)
|
|
||||||
else
|
|
||||||
template.render(self, locals)
|
|
||||||
end
|
|
||||||
|
|
||||||
@_content_for[:layout] = content
|
@_content_for[:layout] = content
|
||||||
|
|
||||||
if layout
|
if layout
|
||||||
@_layout = layout.identifier
|
@_layout = layout.identifier
|
||||||
logger.info("Rendering template within #{layout.inspect}") if logger
|
logger.info("Rendering template within #{layout.inspect}") if logger
|
||||||
content = layout.render(self, locals) {|*name| _layout_for(*name) }
|
content = layout.render(self, locals) { |*name| _layout_for(*name) }
|
||||||
end
|
end
|
||||||
|
|
||||||
content
|
content
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue