 
     @trigger('rendered')
 
+superView =
+  templateContext: (view) ->
+    if view.templateContext?
+      view.templateContext?() or view.templateContext
+    else
+      config.defaultTemplateContext(view)
+  locateTemplate: (view) ->
+    if view.template?
+      view.template?() or view.template
+    else
+      config.defaultTemplateLocator(view)
 
 ###
 Extendable Configuration.

config =
  templateFunction: (name) ->
    root.JST[name]
  locateTemplate: (view) ->
    if view.template?
      view.template?() or view.template
    else
      name = fixins.helpers.constructorNameOf(view)
      "templates/#{fixins.helpers.titleToSnakeCase(name)}"
  templateContext: (view) ->
    if view.templateContext?
      view.templateContext?() or view.templateContext
    else
     (view.model or view.collection)?.toJSON() or {}

###
# Random helpers. Pretend these are private, but I won't hide them


class Backbone.Fixins.SuperView extends Backbone.View
  render: ->
    template = config.templateFunction(superView.locateTemplate(@))
    context = superView.templateContext(@)
    @$el.html(template(context))

    for f in _(@).functions()
