ここで説明されているように、Rails 4 で制約のスコープを作成することは可能ですか?
ルート.rb
scope format: true, constraints: { format: 'json' } do
get '/bar' => "bar#index_with_json"
end
私が得ているエラーは
NoMethodError (undefined method 'source' for "json":String):
config/routes.rb:17:in `block (2 levels) in <top (required)>'
config/routes.rb:16:in `block in <top (required)>'
config/routes.rb:1:in `<top (required)>'