Permalink
Browse files

added a 'callback' parameter for JSON-P compatibility.

  • Loading branch information...
Dhruv Bansal
Dhruv Bansal committed Sep 5, 2012
1 parent 2a9455a commit b545138a73171c33abe3ed8a5143c2d3b0c6440c
Showing with 6 additions and 1 deletion.
  1. +6 −1 innovation_matcher.rb
View
@@ -66,7 +66,12 @@ def retrieve_match uuid
end
def pretty_json obj
- obj.to_json + "\n"
+ output = obj.to_json
+ if params['callback']
+ [params['callback'], '(', output, ")\n"].join('')
+ else
+ output + "\n"
+ end
end

0 comments on commit b545138

Please sign in to comment.