I am using pretty_generate in my controller, but I am getting the following error
'only generation of JSON objects or arrays allowed'
@celebrities = Celebrity.includes(:category)
respond_to do |format|
format.json { render json: JSON.pretty_generate(@celebrities.to_json(:include =>{:category => {:only => [:category]} })) }
end
I am not sure why I am getting this error