I have a controller that sometimes renders html and sometimes json.
For json I use jbuilder views.
There is a default html layout, that for some unknown reason start to get rendered also for the json view.
I found 2 options that fixes the issue
- add
layout:false
to the render call with the json view - call render partial instead a regular render.
I'm just wondering(cause it didn't rendered the layout a few days ago) Is there a way to tell rails to render the layout only for html request formats ?