diff options
Diffstat (limited to 'actionview/lib/action_view/renderer/template_renderer.rb')
-rw-r--r-- | actionview/lib/action_view/renderer/template_renderer.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/actionview/lib/action_view/renderer/template_renderer.rb b/actionview/lib/action_view/renderer/template_renderer.rb index 4bcf009e27..ce8908924a 100644 --- a/actionview/lib/action_view/renderer/template_renderer.rb +++ b/actionview/lib/action_view/renderer/template_renderer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_support/core_ext/object/try" module ActionView @@ -22,8 +24,6 @@ module ActionView if options.key?(:body) Template::Text.new(options[:body]) - elsif options.key?(:text) - Template::Text.new(options[:text], formats.first) elsif options.key?(:plain) Template::Text.new(options[:plain]) elsif options.key?(:html) @@ -40,13 +40,13 @@ module ActionView find_template(options[:template], options[:prefixes], false, keys, @details) end else - raise ArgumentError, "You invoked render but did not give any of :partial, :template, :inline, :file, :plain, :html, :text or :body option." + raise ArgumentError, "You invoked render but did not give any of :partial, :template, :inline, :file, :plain, :html or :body option." end end # Renders the given template. A string representing the layout can be # supplied as well. - def render_template(template, layout_name = nil, locals = nil) #:nodoc: + def render_template(template, layout_name = nil, locals = nil) view, locals = @view, locals || {} render_with_layout(layout_name, locals) do |layout| @@ -56,7 +56,7 @@ module ActionView end end - def render_with_layout(path, locals) #:nodoc: + def render_with_layout(path, locals) layout = path && find_layout(path, locals.keys, [formats.first]) content = yield(layout) |