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
Post a Comment