Rails makes all routes default to :: json format
Can you set all default routes to json
?
I have the following for the api scope, but I am wondering if you can do the same for the global scope?
scope :api, defaults: {format: :json} do
get "/search(/:query)(/:location)" => "search#index"
end
For example, all resources will user
also default tojson
resources :users
+3
source to share