In Rails you can specify defaults for a group of routes (within a namespace) like so:
Rails.application.routes.draw do
# Other routes
namespace :api, defaults: { format: :json } do
resources :users
end
end
How can I apply defaults like this to all the routes within the application?