 
           # is Routing Mixin?
           if index.views.MixinView.listMixins(view).indexOf(Routing) > -1
-            @routers[url] = new view({router: @, prefix: prefix})
-
-          # normal class based view
-          opts = {router: @, viewClass: view, prefix: prefix}
-          console.log ">>>", opts.prefix
-          opts.namedParams = opts.prefix.match(/:([a-z\-\_]+)/gi)
-          callback = @update.bind(@, opts)
+            @routers[url] = new view
+              router: @,
+              prefix: prefix
+          else
+            # normal class based view
+            opts = {router: @, viewClass: view, prefix: prefix}
+            opts.namedParams = opts.prefix.match(/:([a-z\-\_]+)/gi)
+            callback = @update.bind(@, opts)
 
         else if _.isFunction view
           callback = view
-          console.log view
 
         else
-          console.log "Nothing", view
+          console.error "This view is not an view class or callback", view
 
-        console.log @prefix + url, url, callback
-        @_router.route(@prefix + url, callback)
-        console.log Backbone.history
-        # @routes[options.router] opts
+        if callback
+          @_router.route(@prefix + url, url, callback)
+
+  remove: () ->
+    console.log "detaching element"
+    $(@el).detach()
 
   update: (options={}) ->
-    console.log("updating", options.viewClass, options)
     reverse = options.reverse
+
+    # attach the router if isn't attached
+    if not document.body.contains @el
+      if @router
+        @router.update
+          view: @
+          reverse: reverse
+      else
+        new Exception(
+          "Don't know how you want to attach this router to the dom.
+          Usually it is rendered and attached by another view or the main app"
+        )
+
     old = @view
-
     if old
       # notify the old view that it is being transitioned out
       Backbone.trigger "routing:closing",


      for url in Object.keys(@routes).reverse()
        view = @routes[url]

        # TODO: check if view is a backbone router


  routes: {}

  initialize: (options={}) ->
    @router = options.router

    if not Backbone.History.started
      @prefix = options.prefix or ""
      if "*" in @prefix
