Fix 404 error while displaying json files.

It uses params[:id] instead of request.fullpath.
It should fix #3132.