I've generated a new rails 4 (rc1) project using rails new
and generated a scaffold using rails g scaffold
.
As expected it has created the migration, controller and all required view files.
It has also created show.json.jbuilder and index.json.jbuilder.
I assume this is to aid json generation from models. The controller contains format.json invocations as well.
Question: why does it require json and which part of the generated application is using json? It doesn't look like (for me) the views are using json to render anything, seems they are rendered on the server side (@model variables are used in the views to get the content).
The edge guides (http://edgeguides.rubyonrails.org/) don't see to mention jbuilder and why it's needed there.
Thanks in advance! Please let me know if I can clarify the question.