Rendering 'as JSON' in Grails with conditional operator doesn't render correctly
问题 Came across this strange result today trying to render a list of objects as JSON in Grails 2.0.4...(i know i'm gonna regret asking this on account of something right under my nose... updated 5/26, my prediction was correct, see below :-)) This works fine; the JSON renders correctly in the browser... def products = [] //ArrayList of Product objects from service def model = (products) ? [products:products] : [products:"No products found"] render model as JSON ..so why doesn't this shortened