OSDN Git Service

fix profiler
[pettanr/pettanr.git] / app / assets / javascripts / routes.js.coffee
index 1b45072..acfaa44 100644 (file)
@@ -59,11 +59,19 @@ class Pettanr.Router extends Backbone.Router
         else\r
           params['action'] = 'index'\r
       this.fire(params)\r
+    this['c'] = (controller, query_string) ->\r
+      params = this.parse_query_string(query_string)\r
+      params['controller'] = controller\r
+      params['format'] = 'html'\r
+      params['action'] = 'index'\r
+      this.fire(params)\r
     this.route('', 'home')\r
     this.route(':controller/:id/:action?*query_string', 'c_i_a')\r
     this.route(':controller/:id/:action', 'c_i_a')\r
     this.route(':controller/:id?*query_string', 'c_i')\r
     this.route(':controller/:id', 'c_i')\r
+    this.route(':controller?*query_string', 'c')\r
+    this.route(':controller', 'c')\r
   \r
   home: () ->\r
     params = {}\r