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.
.jsonユーザーがサフィックスとしてアクションを指定した場合 (例: admin/users.json)、json の戻り値で応答を取得する API を開発しています。それ以外の場合は、通常の html ビューを取得します。
.json
admin/users.json
一部のアクションには json 応答がない場合があります。その場合、アクションは単に html ビューを返します。
これをきれいに実装する方法について誰かアドバイスがありますか? ルーティングで達成できると思っていました。