grails - How to only send certain properties of a class as json -
i have simple action such this:
def showsomething() { render color.get(params.id) json } this render properties in color class json. however, if want render 2 properties, say, colorname , shade?
gjordis has right option if want render same properties everytime render object. however, this:
color color = color.get(params.id) render ([colorname: color.colorname, shade: color.shade] json)
Comments
Post a Comment