Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私がカールするか、別のサーバーが私のサーバーを呼び出すと、フォーマットはとして解釈され*/*ます。jbuilderをインストールしたので、常にjsonで応答します。
*/*
応答するフォーマットの優先順位を調整するにはどうすればよいですか*/*。
問題はrespond_to行動に関係していた。
respond_to
次のようなアクションで:
respond_to do |fmt| fmt.json fmt.html end
タイプのリクエストはすべて*/*jsonになります。
htmlにするには、応答する最初の形式にする必要があります。
respond_to do |fmt| fmt.html fmt.json end