Use format from Rails instead of trying to guess it.