              .replace(/\*/g, '(.+)');
   return new RegExp('^' + path + '$', 'i');
 
+
+getHelper = (url) ->
+  helperClassName = url.replace /^[a-zA-Z]|\/[a-zA-Z]/g, (x) -> x.toUpperCase()
+  helperClassName = helperClassName.replace(/\//g, "")+ "Helper"
+  return window[helperClassName]
+
 routes = {}
 routeMethods = ["get", "post", "put", "delete"]
 

    matchRoute("put", url, params, push)

  delete: (url, push) ->
    matchRoute("delete", url, push)
}

    matches = url.match obj.regex

    if matches

      new LiveView "/views" + url + ".html", {}, (view) -> 
        ctor = getHelper url
        if ctor?
          helper = new ctor(view)
        else 
          helper = () ->
        merge params, zipObject(obj.keys, matches.slice(1))
        methods = { 
                    url: url,
                    view: view, 
                    autoRender: true
                    helper: helper
                  }
        
        stopRoute = false
        _.each obj.filters.before, (filter) ->
          if !stopRoute && filter.call(methods, params) == false
            stopRoute = true
        if stopRoute
          return

        obj.callback.call methods, params 

        _.each obj.filters.after, (filter) ->
          filter(params)

        if push
          $("body").attr("class", url.replace(/\//g, " ").trim())
          window.history.pushState { method: method, params: params }, "", url
        if(methods.autoRender)
          $("#main").html(methods.view.context)
      return

registerRoute = (method, route, filters, callback) ->
