- initialize: () ->\r
- this['c_i_a'] = (controller, id, action, query_string) ->\r
- params = this.parse_query_string(query_string)\r
- params['controller'] = controller\r
- params['format'] = 'html'\r
- t = id.split('.')\r
- if t.length > 1\r
- params['format'] = t[1]\r
- id = t[0]\r
- t = action.split('.')\r
- if t.length > 1\r
- params['format'] = t[1]\r
- action = t[0]\r
- if Pettanr.is_number(action)\r
- params['action'] = id\r
- params['id'] = action\r
- else\r
- params['action'] = action\r
- params['id'] = id\r
- this.fire(params)\r
- this['c_i'] = (controller, id, query_string) ->\r
- params = this.parse_query_string(query_string)\r
- params['controller'] = controller\r
- params['format'] = 'html'\r
- t = id.split('.')\r
- if t.length > 1\r
- params['format'] = t[1]\r
- id = t[0]\r
- if Pettanr.is_number(id)\r
- params['action'] = 'show'\r
- params['id'] = id\r
- else\r
- if id\r
- params['action'] = id\r
- 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
- this.route('users/sign_in', 'user_sign_in')\r
+ peta_routes: () ->\r
+ [\r
+ {route: '', callback: 'home'}, \r
+ {route: ':controller/:id/:action?*query_string', callback: 'c_i_a'}, \r
+ {route: ':controller/:id/:action', callback: 'c_i_a'}, \r
+ {route: ':controller/:id?*query_string', callback: 'c_i'}, \r
+ {route: ':controller/:id', callback: 'c_i'}, \r
+ {route: ':controller?*query_string', callback: 'c'}, \r
+ {route: ':controller', callback: 'c'}, \r
+ {route: 'users/sign_in', callback: 'user_sign_in'}, \r
+ ]\r