branaway/Japid — Issue #42: Implement a $jsRoute() static method
Author: agileconsulting
Created: 2012-01-17 19:09:22+00:00
State: open

Hi,

Play introduced a #{jsRoute} tag in 1.2.4 (see http://www.playframework.org/documentation/1.2.4/tags#jsroute). The corresponding commit is https://github.com/playframework/play/commit/02d4176e4e0422765b1e97.

It would be great to include a jsRoute static method in the JapidPlayAdapter (https://github.com/branaway/Japid/blob/master/src.japidplay/cn/bran/play/JapidPlayAdapter.java).

In addition, the RouteAdapter (https://github.com/branaway/Japid/blob/master/src.japidplay/cn/bran/play/RouteAdapter.java) should probably provide a method to obtain an ActionDefinition object as it's created in the lookup() method.

The JapidPlayAdapter can then, as it can be seen in the Play commit above, use the ActionDefinition object in the new jsRoute static method.

Having that would make a switch from the Groovy templating engine to Japid much easier. No javascript code would have to be modified.

Sorry for not providing you with a pull request. I thought setting up the Japid project locally and changing the code takes much longer than letting you do it with the information provided in this issue.

Thanks,

Mike