template_format (ActionView::Base)

    # File lib/action_view/base.rb, line 298
        def template_format
          return @template_format if @template_format

          if controller && controller.respond_to?(:request)
            parameter_format = controller.request.parameters[:format]
            accept_format    = controller.request.accepts.first

            case
            when parameter_format.blank? && accept_format != :js
              @template_format = :html
            when parameter_format.blank? && accept_format == :js
              @template_format = :js
            else
              @template_format = parameter_format.to_sym
            end
          else
            @template_format = :html
          end
        end