Rails – How to add a format to an url helper? September 11, 2023 by Tarik You should be able to do something like this: some_resource_path(format: :json) or some_resource_url(format: :xml)