Skip to content

Commit

Permalink
js function created by jsRouter tag shouldn't include null parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
pepite committed May 10, 2012
1 parent ae46af8 commit 12a763c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/src/play/templates/FastTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static void _jsRoute(Map<?, ?> args, Closure body, PrintWriter out, Execu
if (action.args.isEmpty()) {
out.print("url: function() { return '" + action.url.replace("&amp;", "&") + "'; },");
} else {
out.print("url: function(args) { var pattern = '" + action.url.replace("&amp;", "&") + "'; for (var key in args) { pattern = pattern.replace(':'+key, args[key]); } return pattern; },");
out.print("url: function(args) { var pattern = '" + action.url.replace("&amp;", "&") + "'; for (var key in args) { pattern = pattern.replace(':'+key, args[key] || ''); } return pattern; },");
}
out.print("method: '" + action.method + "'");
out.print("}");
Expand Down

0 comments on commit 12a763c

Please sign in to comment.