I have jbuilder file:
app/views/api/items/show.json.jbuilder
code
render :show
#or
render :show, template: "api/items/show"
does not worked - template is missing
, but code
render :show, template: "api/items/show.json"
worked fine.
What is wrong? What need to check? Which file to see or what to dump?
You will have to use the respond_to
method to tell Rails you're responding to a json
request.
def show
respond_to do |format|
format.json
end
end