0

A controller using json views will call the json view corresponding to the controller method called when rendering domains.

I want however to pass the controller params to the json view in addition to the domains, to customize the way a domain is rendered.

A typical example of the use of such a feature is to either display the domains rendered in an index endpoint in a short or detailed way.

How can I make pass the controller params to the json view?

Heschoon
  • 2,915
  • 9
  • 26
  • 55

1 Answers1

2

How can I make pass the controller params to the json view?

You don't have to do anything. You can reference the params variable in a JSON view. We provide direct access that way.

For more info, see the "Accessing The Request" section at http://views.grails.org/latest/.

Jeff Scott Brown
  • 26,804
  • 2
  • 30
  • 47