lib/action_view/renderer/template_renderer.rb
# Determine the template to be rendered using the given options.
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[:locals].try(:keys) || []
      if options.key?(:text)
        Template::Text.new(options[:text], formats.try(:first))
      elsif options.key?(:file)
        with_fallbacks { find_template(options[:file], nil, false, keys) }
      elsif options.key?(:inline)
        handler = Template.handler_for_extension(options[:type] || "erb")
        Template.new(options[:inline], "inline template", handler, :locals => keys)
      elsif options.key?(:template)
        options[:template].respond_to?(:render) ?
          options[:template] : find_template(options[:template], options[:prefixes], false, keys)
      end
    end
def determine_template ( options ) keys = options [ :locals ] . try ( :keys ) || [ ] if options . key? ( :text ) Template :: Text . new ( options [ :text ] , formats . try ( :first ) ) elsif options . key? ( :file ) with_fallbacks { find_template ( options [ :file ] , nil , false , keys ) } elsif options . key? ( :inline ) handler = Template . handler_for_extension ( options [ :type ] || "erb" ) Template . new ( options [ :inline ] , "inline template" , handler , :locals => keys ) elsif options . key? ( :template ) options [ :template ] . respond_to? ( :render ) ? options [ :template ] : find_template ( options [ :template ] , options [ :prefixes ] , false , keys ) end end
Determine the template to be rendered using the given options.
Determine the template to be rendered using the given options .
#:nodoc:
options