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

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

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -