I currently have the following code and it works fine:
respond_to do |format|
format.json { render :show, status: :ok }
end
I believe :show
is referring to a jbuilder view.
However, if I wanted to add a local variable to the json render, how would I do that?
I've tried the following but it hasn't worked.
auth = true
format.json { render :show, :include => auth, status: :ok }
and I've also tried
auth = true
format.json { render :show.include(auth), status: ok }
From what I found at render :json does not accept options