names = _.map Manifest.manifest().controllers, (controller_manifest, controller_name) ->\r
c = Pettanr[Pettanr.camelize(controller_name) + 'Controller']\r
controller = new c\r
- _.map controller_manifest.actions, (action_manifest, action_name) ->\r
+ _.map controller_manifest.actions, (action_manifest, action_name) =>\r
{\r
event_name: controller_name + '_' + action_name, \r
controller: controller,\r
action_manifest: action_manifest,\r
action_name: action_name\r
}\r
- _this = this\r
- _.each _.flatten(names), (status) ->\r
+ _.each _.flatten(names), (status) =>\r
_status = status\r
switch status.action_manifest.type\r
when 'list'\r
e = status.event_name\r
e_f = e + '_format'\r
- _this[e] = (queryString) ->\r
- params = _this.parse_query_string(query_string)\r
+ this[e] = (queryString) =>\r
+ params = @parse_query_string(query_string)\r
console.log(params)\r
_status.controller[_status.action_name](params)\r
c = _status.controller_name\r
a = _status.action_name\r
c_a_url = c + '/' + a\r
- _this.route(c_a_url, e)\r
+ @route(c_a_url, e)\r
r = r + '?*queryString'\r
- _this.route(r, _status.event_name)\r
+ @route(r, _status.event_name)\r
if _status.action_name == 'index'\r
r = _status.controller_name + '/'\r
- _this.route(r, _status.event_name)\r
+ @route(r, _status.event_name)\r
when 'show'\r
e = status.event_name\r
e_f = e + '_format'\r
- _this[e] = (id, query_string) ->\r
- params = _this.parse_query_string(query_string)\r
+ this[e] = (id, query_string) =>\r
+ params = @parse_query_string(query_string)\r
t = id.split('.')\r
if t.length > 1\r
params['format'] = t[1]\r
console.log(id)\r
console.log(params)\r
_status.controller[_status.action_name](id, params)\r
- _this[e_f] = (id, format, query_string) ->\r
- params = _this.parse_query_string(query_string)\r
+ this[e_f] = (id, format, query_string) =>\r
+ params = @parse_query_string(query_string)\r
params['format'] = format\r
console.log(id)\r
console.log(params)\r
c_id_a_f_url = c + '/:id/' + a + '.:format'\r
c_id_a_q_url = c_id_a_url + q\r
c_id_a_q_url = c_id_a_url + '.:format' + q\r
- _this.route(c_id_a_q_url, e_f)\r
- _this.route(c_id_a_q_url, e)\r
- _this.route(c_id_a_f_url, e_f)\r
- _this.route(c_id_a_url, e)\r
+ @route(c_id_a_q_url, e_f)\r
+ @route(c_id_a_q_url, e)\r
+ @route(c_id_a_f_url, e_f)\r
+ @route(c_id_a_url, e)\r
if a == 'show'\r
c_id_url = c + '/:id'\r
c_id_q_url = c_id_url + q\r
- _this.route(c_id_q_url, e)\r
- _this.route(c_id_url, e)\r
+ @route(c_id_q_url, e)\r
+ @route(c_id_url, e)\r
\r