diff options
Diffstat (limited to 'actionview/lib/action_view/renderer/template_renderer.rb')
-rw-r--r-- | actionview/lib/action_view/renderer/template_renderer.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/actionview/lib/action_view/renderer/template_renderer.rb b/actionview/lib/action_view/renderer/template_renderer.rb index 331a5ea228..f40bf8f6e2 100644 --- a/actionview/lib/action_view/renderer/template_renderer.rb +++ b/actionview/lib/action_view/renderer/template_renderer.rb @@ -16,14 +16,12 @@ module ActionView private - # Determine the template to be rendered using the given options. + # Determine the template to be rendered using the given options. def determine_template(options) keys = options.has_key?(:locals) ? options[:locals].keys : [] 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,12 +38,12 @@ 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. + # Renders the given template. A string representing the layout can be + # supplied as well. def render_template(template, layout_name = nil, locals = nil) #:nodoc: view, locals = @view, locals || {} @@ -69,9 +67,9 @@ module ActionView end end - # This is the method which actually finds the layout using details in the lookup - # context object. If no layout is found, it checks if at least a layout with - # the given name exists across all details before raising the error. + # This is the method which actually finds the layout using details in the lookup + # context object. If no layout is found, it checks if at least a layout with + # the given name exists across all details before raising the error. def find_layout(layout, keys, formats) resolve_layout(layout, keys, formats) end |