There is the following code for routing:
resources :orders, only: [:create], defaults: { format: \'json\' } resources :users, only: [:create, :update],
That worked for me:
scope defaults: { format: 'json' } do resources :users, only: [:index] end