How to realize the following routing in rails:
if the request is requiring
html
, than route to a specific action, let's say application#indexin case of a
json
format request, route to the resources just normally to action which produce the requestedjson
Obviously that's a use case for a single page application, where rails is mostly used only for serving json
s. Most of the pages are just very simple layouts with some values bootstrapped.
Thanks for hints.