Rails make all routes default to format: :json -


can make routes default json?

i have following api scope wondering if can same global scope?

  scope :api, defaults: {format: :json}     "/search(/:query)(/:location)" => "search#index"   end 

for example user resources default json

resources :users 

use constraints

constraints format: :json   resources :users end 

or

resources :users, :defaults => { :format => 'json' } 

Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -